Received: from mail.greatbasin.net (mail.greatbasin.net [207.228.35.39]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3PHJ7305981 for ; Wed, 25 Apr 2001 13:19:07 -0400 (EDT) (envelope-from jeremy@wellsgaming.com) Received: from [172.16.1.6] (rno-dsl0b-131.gbis.net [216.82.145.131]) by mail.greatbasin.net (8.9.3-MySQL-0.2.3b/8.9.3) with ESMTP id KAA05164; Wed, 25 Apr 2001 10:18:56 -0700 (PDT) User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022 Date: Wed, 25 Apr 2001 10:16:37 -0700 Subject: Re: Can't drop table (repost) From: Jeremy Buchmann To: Tom Lane CC: pgsql-admin Message-ID: In-Reply-To: <29055.988214850@sss.pgh.pa.us> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Archive-Number: 200104/126 X-Sequence-Number: 1263 > Jeremy Buchmann writes: >> I have a weird situation here...I'm trying to drop a table, but it tells me >> that "Relation 'xxxxxxx' inherits 'mytable'". So I renamed mytable to >> myoldtable and created a new mytable. Now, the new mytable is missing the >> fields I was trying to add, and when I try to drop it, it says "Relation >> 'xxxxxxx' inherits 'mytable'". And when I try to drop myoldtable, it says >> "Relation 'xxxxxxx' inherits 'myoldtable'". How do I get out of this mess? > > You can't drop a table that has inheritance children --- you have to > drop the children first. And renaming tables doesn't affect the > inheritance relationships. Okay great, but how do I know what tables I need to drop if it just gives me a number? That 'xxxxxxx' is just some number like '8892659'. Where is the mapping from number->name? And do you think this inheritance "feature" could be mentioned in the user guide? >> Also, I noticed some tables named like pg_temp.1970.0 and such. They seem >> to contain some junk data from queries or something, but it won't let me >> delete them...how can I get rid of them? > > Those are temp tables; if a backend crashed while it had a temp table > created, then you'd see the leftover tables. Offhand I think you won't > be allowed to delete 'em unless you restart the postmaster with the > allow-system-table-mods switch. It is possible that these temp tables could be inherited from the "mytable" mentioned above...if I removed them with the allow-system-table-mods, would that fix the pg_inherits table so that mytable could be removed? --Jeremy