1
我有一個OID生成一個顯然無效的元組。Postgres:`高速緩存查找失敗的約束34055`
這是試圖刪除表中PSQL一些\set VERBOSITY verbose
後,當我得到的錯誤:
delete from my_table where my_column = 'some_value';
ERROR: XX000: cache lookup failed for constraint 34055
LOCATION: ri_LoadConstraintInfo, ri_triggers.c:2832
這是我發現elsewhere。
2827 : /*
2828 : * Fetch the pg_constraint row so we can fill in the entry.
2829 : */
2830 548 : tup = SearchSysCache1(CONSTROID, ObjectIdGetDatum(constraintOid));
2831 548 : if (!HeapTupleIsValid(tup)) /* should not happen */
2832 0 : elog(ERROR, "cache lookup failed for constraint %u", constraintOid);
2833 548 : conForm = (Form_pg_constraint) GETSTRUCT(tup);
2834 :
2835 548 : if (conForm->contype != CONSTRAINT_FOREIGN) /* should not happen */
2836 0 : elog(ERROR, "constraint %u is not a foreign key constraint",
我讀到這意味着OID正在其他地方被引用。這些其他地方在哪裏,有誰知道我如何清理這樣的事情?
我真的喜歡上2831線