Re: Can't drop table (repost)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeremy Buchmann <jeremy(at)wellsgaming(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Can't drop table (repost)
Date: 2001-04-25 16:07:30
Message-ID: 29055.988214850@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Jeremy Buchmann <jeremy(at)wellsgaming(dot)com> 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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2001-04-25 17:02:23 Re: Reason to not upgrade from 6.5 to 7.0 or above
Previous Message Thomas Heller 2001-04-25 14:37:04 7.1 performance