whysthatso

Postgresql Performing Cache Lookup Failed For Relation

Posted on July 2, 2025

I had a weird state of a table where dropping it would return the error ‘performing cache lookup failed for relation '

what fixed it was looking up the oid and then just removing all its entries.

select from pg_depend where objid = MY_OID;
delete from pg_class where oid = MY_OID;
delete from pg_depend where objid = MY_OID;
delete from pg_constraint where conrelid = MY_OID;

might be very invasive, the state of that dataset was not too important.

Hey! I'll happily receive your comments via email. Thanks for reading.

Andreas Wagner
freelance System Administrator and Ruby programmer in Tallinn, Estonia