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