X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6C061D1D05F for ; Sun, 11 Apr 2004 19:58:54 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 57736-05 for ; Sun, 11 Apr 2004 19:58:58 -0300 (ADT) Received: from mail1.elevating.com (wsip-68-99-77-237.tu.ok.cox.net [68.99.77.237]) by svr1.postgresql.org (Postfix) with ESMTP id 0D6FAD1CCB7 for ; Sun, 11 Apr 2004 19:58:51 -0300 (ADT) Received: from bretsony.hugheshome.org (bretsony.brets.elevating.com [10.23.0.50]) (authenticated) by mail1.elevating.com (8.11.6/8.11.6) with ESMTP id i3BMwcF05490; Sun, 11 Apr 2004 17:58:38 -0500 Subject: Re: trigger/for key help From: Bret Hughes To: Tom Lane Cc: Stephan Szabo , postgresql sql list In-Reply-To: <17189.1081720813@sss.pgh.pa.us> References: <1081662204.6609.72.camel@bretsony> <20040411080932.Q83278@megazone.bigpanda.com> <1081711155.6399.165.camel@bretsony> <17189.1081720813@sss.pgh.pa.us> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 (1.0.8-9.7x.1) Date: 11 Apr 2004 17:58:37 -0500 Message-Id: <1081724318.2628.20.camel@bretsony> Mime-Version: 1.0 X-Elevating-MailScanner: Found to be clean X-Elevating-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.5, required 5, BAYES_00 -1.50) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/111 X-Sequence-Number: 17486 On Sun, 2004-04-11 at 17:00, Tom Lane wrote: > Bret Hughes 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. Bret