473,385 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Cache lookup failed for relation, when trying to DROP TABLE.

Hello,
I've just encountered a problem that I don't know how to deal with.
After having a play with SlonyI, I dropped the entire slony cluster
schema, and then tried to drop a schema which held some slave tables
for the slony cluster.

I kept getting the following error:

ERROR: cache lookup failed for relation 4667548

So, I cleared out everything I could manually from the schema,
leaving four remaining tables that refuse to be dropped, giving
the error above (the relation oid varies though).

Anyone know what this means?

Is there a way to forcefully remove these tables and the schema
using the pg_catalog tables?

Is there any other information I should provide that may help?

Specs:
Redhat Enterprise Linux 3
PostgreSQL 7.4.5
Slony-I 1.0.2

Cheers
--
Mark Gibson <gibsonm |AT| cromwell |DOT| co |DOT| uk>
Web Developer & Database Admin
Cromwell Tools Ltd.
Leicester, England.

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #1
8 12574
Mark Gibson <gi*****@cromwell.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.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #2
Tom Lane wrote:
Mark Gibson <gi*****@cromwell.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.

"\set VERBOSITY verbose" gave me the following:

ERROR: XX000: cache lookup failed for relation 4667548
LOCATION: getRelationDescription, dependency.c:1755
and...

After sticking 4667548 everywhere an oid can be stuck, I've found an
entry in the pg_rewrite table.
It's from a rule I added myself, but I dropped it manually, strange that
is still lurking around.

So, I tried deleting the offending entries from pg_rewrite, and now get:

ERROR: XX000: could not find tuple for rule 5173132
LOCATION: getObjectDescription, dependency.c:1669

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?

--
Mark Gibson <gibsonm |AT| cromwell |DOT| co |DOT| uk>
Web Developer & Database Admin
Cromwell Tools Ltd.
Leicester, England.

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #3
Mark Gibson wrote:
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?


Right then, I think I've got this sorted,
DROP TABLE worked after a swift:

DELETE FROM pg_depend WHERE objid = 5173132;

Then DROP SCHEMA also worked.

Do you think I should be safe to continue working with the database now,
without a full dump and restore?
(It's not in production use, but it would take quite some time for
dump/restore)

Cheers.
--
Mark Gibson <gibsonm |AT| cromwell |DOT| co |DOT| uk>
Web Developer & Database Admin
Cromwell Tools Ltd.
Leicester, England.

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #4
Mark Gibson <gi*****@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

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #5
Tom Lane wrote:
Mark Gibson <gi*****@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?


I haven't modified anything manually in pg_catalog.
The rule was dropped with DROP RULE.
Although I have been testing out Slony-I, I'm not sure if that has
delved into pg_catalog, I'll have to check with the Slony folks.
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.

--
Mark Gibson <gibsonm |AT| cromwell |DOT| co |DOT| uk>
Web Developer & Database Admin
Cromwell Tools Ltd.
Leicester, England.

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #6
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.

A

--
Andrew Sullivan | aj*@crankycanuck.ca
The fact that technology doesn't work is no bar to success in the marketplace.
--Philip Greenspun

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #7
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.

--
Mark Gibson <gibsonm |AT| cromwell |DOT| co |DOT| uk>
Web Developer & Database Admin
Cromwell Tools Ltd.
Leicester, England.

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #8
On 10/15/2004 4:20 AM, Mark Gibson wrote:
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.


Yes, this is the ugly bit of catalog scrbbling Slony-I 1.0 does. We have
ideas to clean this up in 1.1.
Jan

--
#================================================= =====================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================= = Ja******@Yahoo.com #

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jeff Boes | last post by:
What might be the source of this error? Cache lookup failed for relation 188485009 We've been getting these at odd intervals, and they are not reproducible. Our setup: PostgreSQL 7.3.3...
3
by: Terrence Brannon | last post by:
I don't know what Postgres considers a relation and had no intention of creating one when piping my schema to it... I always DROP TABLE before CREATE TABLE, so here are the ERRORS emitted when...
0
by: culley harrelson | last post by:
I am getting this error: fmgr_info: function 7390843: cache lookup failed when trying to insert some data into a table using the tsearch2 contrib module (this is postgresql 7.3). I have the...
3
by: my-wings | last post by:
I've been reading about how evil Lookup fields in tables are, but I've got to be missing something really basic. I know this subject has been covered before, because I've just spent an hour or two...
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
4
by: Paul | last post by:
Hi, When should I use a list (in table properties: like Ford;Mercedes;BMW;Audi ) and when should I use a lookup table?? And second question: IF I use a lookup table, should I always make a...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
7
by: Juris Krumins | last post by:
I have a problem with postgresql tables. periodicaly, I would say frequently about 5-10 time per hour i have such errors in my server log file: 2004-04-14 12:23:32 ERROR: cache lookup of...
10
by: Razvan Surdulescu | last post by:
After I restore a Postgres database (using pg_restore), I get the following error message when I try to run a simple UPDATE query: ERROR: cache lookup failed for function 70529 More details:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.