Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3PG7m374846 for ; Wed, 25 Apr 2001 12:07:48 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f3PG7UR29058; Wed, 25 Apr 2001 12:07:31 -0400 (EDT) To: Jeremy Buchmann cc: pgsql-admin Subject: Re: Can't drop table (repost) In-reply-to: References: Comments: In-reply-to Jeremy Buchmann message dated "Tue, 24 Apr 2001 08:31:53 -0700" Date: Wed, 25 Apr 2001 12:07:30 -0400 Message-ID: <29055.988214850@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200104/123 X-Sequence-Number: 1260 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. > 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. > I'm using pgsql 6.5.3 on Linux 2.2 Time to upgrade... regards, tom lane