can't delete because of constraint from zombie table - Mailing list pgsql-general

From Jaime Silvela
Subject can't delete because of constraint from zombie table
Date
Msg-id 455E1AC6.5000805@bear.com
Whole thread Raw
In response to Re: Select slow over network  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Responses Re: THIS EMAIL DID NOT COME FROM BEAR STEARNS - Subject::  (Jaime Silvela <JSilvela@Bear.com>)
Re: can't delete because of constraint from zombie table  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I'm finding a strange sort of 'zombie' table behavior.
I try to delete a row of a database that used to be referenced by a
table that has now been deleted.

I do
delete from staging_deal where staging_deal_id = 1
and get
ERROR:  update or delete on "staging_deal" violates foreign key
constraint "staging_deal_fkey" on "staging_document"
DETAIL:  Key (staging_deal_id)=(1) is still referenced from table
"staging_document".

I try to find that table
select * from staging_document
but
ERROR:  relation "staging_document" does not exist

However pg_class does know that table
select * from pg_class where relname = 'staging_document'
gives me a row

The version is
"PostgreSQL 8.1.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.0.3"

I've tried reindexing pg_class, but the issue hasn't been solved.
Restarting Postgres doesn't help either.
On thing I tried in a test deployment was to delete the row from
pg_class, but I get
ERROR:  could not open relation with OID 22427646
type errors, and it seems to leave me worse off.

Any ideas?

Thank you
Jaime


***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation,
offer or agreement or any information about any transaction, customer
account or account activity contained in this communication.

Bear Stearns does not provide tax, legal or accounting advice.  You
should consult your own tax, legal and accounting advisors before
engaging in any transaction. In order for Bear Stearns to comply with
Internal Revenue Service Circular 230 (if applicable), you are notified
that any discussion of U.S. federal tax issues contained or referred to
herein is not intended or written to be used, and cannot be used, for
the purpose of:  (A) avoiding penalties that may be imposed under the
Internal Revenue Code; nor (B) promoting, marketing or recommending to
another party any transaction or matter addressed herein.
***********************************************************************

pgsql-general by date:

Previous
From: Stephen Harris
Date:
Subject: Shutting down a warm standby database in 8.2beta3
Next
From: "Wm.A.Stafford"
Date:
Subject: Copy command to load data into a PostgreSQL DB