Skip site navigation (1) Skip section navigation (2)

Re: trigger/for key help

From: Bret Hughes <bhughes(at)elevating(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>,postgresql sql list <pgsql-sql(at)postgresql(dot)org>
Subject: Re: trigger/for key help
Date: 2004-04-11 22:58:37
Message-ID: 1081724318.2628.20.camel@bretsony (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
On Sun, 2004-04-11 at 17:00, Tom Lane wrote:
> Bret Hughes <bhughes(at)elevating(dot)com> writes:
> > elevating=# drop table test_types;
> > ERROR:  could not find tuple for constraint 2041971
> > I can find no reference to these oids anywhere.
> You haven't looked very hard then ;-).  I expect this is because
> pg_depend has links from the table to the constraints it owns.
> You could probably remove the pg_depend entries to make it possible
> to drop the table.
> Use ALTER TABLE next time, eh?  Hand manipulation of the system catalogs
> is *not* for those who don't know exactly what they are doing.
> 			regards, tom lane

Hmm I thought I had but pg_depend is one that I missed.  I deleted all
refs to rows in pg_depends and was able to drop the table.

FWIW I tried to use alter table but could never get the parser to accept
$1 as a constraint name.  I used single and double quotes as well as a
lame attempt \$1.

Thanks I am breathing better.  I was about to pg_dump and restore into a
test database to see what would happen then since there was no reference
to any of the oids in the error messages found in the dump.

I can now resume climbing up the learning curve.


In response to


pgsql-sql by date

Next:From: Tom LaneDate: 2004-04-12 02:27:21
Subject: Re: trigger/for key help
Previous:From: Tom LaneDate: 2004-04-11 22:00:13
Subject: Re: trigger/for key help

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group