Re: Cache lookup failed for relation, when trying to DROP - Mailing list pgsql-general

From Tom Lane
Subject Re: Cache lookup failed for relation, when trying to DROP
Date
Msg-id 26917.1097078416@sss.pgh.pa.us
Whole thread Raw
In response to Cache lookup failed for relation, when trying to DROP TABLE.  (Mark Gibson <gibsonm@cromwell.co.uk>)
Responses Re: Cache lookup failed for relation, when trying to DROP  (Mark Gibson <gibsonm@cromwell.co.uk>)
List pgsql-general
Mark Gibson <gibsonm@cromwell.co.uk> writes:
> Right then, I think I've got this sorted,
> DROP TABLE worked after a swift:
> DELETE FROM pg_depend WHERE objid = 5173132;

There's something awfully flaky going on here.  The system should never
have let you get into this state in the first place: the entire point of
pg_depend is that you can't delete the referenced object without
deleting the referencing object.  Had you been doing anything odd before
this (like perhaps manually deleting catalog rows)?  You mentioned
having dropped the troublesome rule; did you do that by-the-book with
DROP RULE, or did you just DELETE FROM pg_rewrite?

> Do you think I should be safe to continue working with the database now,
> without a full dump and restore?

Hard to say.  If you haven't been sticking your fingers where they
shouldn't go, then this definitely represents a failure of the
dependency mechanism.  Aside from the possibility of plain old bugs,
I'd be wondering about corrupted indexes on pg_depend.

            regards, tom lane

pgsql-general by date:

Previous
From: Dennis Gearon
Date:
Subject: Re: database constraints
Next
From: frederic.germaneau@bull.net
Date:
Subject: Help on copy function