Ich habe eine OID, die ein Tupel erzeugt, das offensichtlich nicht gültig ist.Postgres: `Cache-Lookup fehlgeschlagen für Constraint 34055`
Dies ist der Fehler, den ich bekommen, wenn eine Tabelle in psql nach einiger \set VERBOSITY verbose
zu löschen versuchen:
delete from my_table where my_column = 'some_value';
ERROR: XX000: cache lookup failed for constraint 34055
LOCATION: ri_LoadConstraintInfo, ri_triggers.c:2832
Dies ist, was ich elsewhere gefunden.
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",
Ich lese das bedeutet die OID wird an anderen Orten referenziert. Wo sind diese anderen Orte und weiß jemand, wie ich so etwas säubern kann?
Ich mag den /* should not happen */
Kommentar auf der Leitung 2831.