![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I kept getting the following error: ERROR: cache lookup failed for relation 4667548 |
#3
| |||
| |||
|
|
Mark Gibson <gibsonm (AT) cromwell (DOT) co.uk> writes: I kept getting the following error: ERROR: cache lookup failed for relation 4667548 This implies that something someplace still has a link to the table with that OID. You could do "\set VERBOSITY verbose" so that the code location the error occurs at gets reported; that might be enough information to guess what sort of thing is linking to the table. Or you could just dig through the system catalogs looking for 4667548 in an OID column that links to pg_class. |
#4
| |||
| |||
|
|
I'm guessing I'm gonna have to route through pg_catalog for this and delete all deps manually, but it this going to be safe? Would I be better off dumping and restoring the whole database? |
#5
| |||
| |||
|
|
Right then, I think I've got this sorted, DROP TABLE worked after a swift: DELETE FROM pg_depend WHERE objid = 5173132; |
|
Do you think I should be safe to continue working with the database now, without a full dump and restore? |
#6
| |||
| |||
|
|
Mark Gibson <gibsonm (AT) cromwell (DOT) 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? |
#7
| |||
| |||
|
|
I had to remove Slony's schema manually as I was having problems with it. I was in the process of removing all Slony related stuff, and all my slave tables when this problem occurred, and was going to start again from scratch. |
#8
| |||
| |||
|
|
On Wed, Oct 06, 2004 at 05:25:58PM +0100, Mark Gibson wrote: I had to remove Slony's schema manually as I was having problems with it. I was in the process of removing all Slony related stuff, and all my slave tables when this problem occurred, and was going to start again from scratch. Did your problem happen on a replica, or on the origin? There's a current dirty, evil hack in Slony that does extremely naughty things in the catalogues on the replicas. This is slated to go away in the future, but at the moment it's possible to trip over it if you don't use Slony's own admin tools. |
#9
| |||
| |||
|
|
Andrew Sullivan wrote: On Wed, Oct 06, 2004 at 05:25:58PM +0100, Mark Gibson wrote: I had to remove Slony's schema manually as I was having problems with it. I was in the process of removing all Slony related stuff, and all my slave tables when this problem occurred, and was going to start again from scratch. Did your problem happen on a replica, or on the origin? There's a current dirty, evil hack in Slony that does extremely naughty things in the catalogues on the replicas. This is slated to go away in the future, but at the moment it's possible to trip over it if you don't use Slony's own admin tools. Yes it was on the slave. After a bit more playing with Slony, I've discovered the cause. I'd created rules on a slave table before subscribing it to the master, Slony was disabling the rule from within pg_catalog, so when I manually removed Slony I had some rogue rules floating around. PostgreSQL didn't know it needed to drop the rules but it was being restricted from dropping the table by unknown deps in pg_depend. |
![]() |
| Thread Tools | |
| Display Modes | |
| |