pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeremy Buchmann <jeremy@wellsgaming.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Can't drop table (repost)
Date: Wed, 25 Apr 2001 12:07:30 -0400
Message-ID: <29055.988214850@sss.pgh.pa.us> (raw)
In-Reply-To: <B70AEA79.29DE%jeremy@wellsgaming.com>
References: <B70AEA79.29DE%jeremy@wellsgaming.com>

Jeremy Buchmann <jeremy@wellsgaming.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



view thread (6+ messages)  latest in thread

Message-ID: <29055.988214850@sss.pgh.pa.us>
Permalink:  ../29055.988214850@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29055.988214850@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jeremy@wellsgaming.com
  Subject: Re: Can't drop table (repost)
  In-Reply-To: <29055.988214850@sss.pgh.pa.us>
  References: <B70AEA79.29DE%jeremy@wellsgaming.com> <29055.988214850@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox