Re: Cache lookup failed for relation, when trying to DROP

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mark Gibson <gibsonm(at)cromwell(dot)co(dot)uk>
Cc: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Cache lookup failed for relation, when trying to DROP
Date: 2004-10-06 16:00:16
Message-ID: 26917.1097078416@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mark Gibson <gibsonm(at)cromwell(dot)co(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message frederic.germaneau 2004-10-06 16:08:28 Help on copy function
Previous Message Dennis Gearon 2004-10-06 15:58:14 Re: database constraints