[GENERAL] DROP TABLE, and children? (fwd)

From: Alvaro Herrera <alvherre(at)protecne(dot)cl>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: [GENERAL] DROP TABLE, and children? (fwd)
Date: 2000-11-27 19:42:29
Message-ID: Pine.LNX.4.30.0011271641140.11803-100000@aguila.protecne.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi:

I posted this in pgsql-general last week, but I got no answer. Maybe I
have better luck this time?

TIA.

--
Alvaro Herrera (<alvherre[(at)]protecne(dot)cl>)

---------- Forwarded message ----------
Date: Tue, 21 Nov 2000 17:26:54 -0300 (CLST)
From: Alvaro Herrera <alvherre(at)protecne(dot)cl>
To: pgsql-general(at)postgresql(dot)org
Subject: [GENERAL] DROP TABLE, and children?

Hi:

If I'm creating some inherited tables from a parent,

rwtest=> CREATE TABLE test (col1 INTEGER);
CREATE
rwtest=> CREATE TABLE testchld () INHERITS (test);
CREATE

and then try to drop the parent, it says

rwtest=> DROP TABLE test;
ERROR: Relation '22057' inherits 'test'

Is there some easy way to DROP all children tables? I was looking
through some old archives, I found that neither UPDATE nor DELETE dealt
with inheritance (some grammar that had to do with relation_name rather
than relation_expr), but couldn't find anything about DROP.

Maybe some query to get all relations that inherit from the one I'm
trying to drop?

TIA.

--
Alvaro Herrera (<alvherre[(at)]protecne(dot)cl>)

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2000-11-27 20:09:46 Re: location of Unix socket
Previous Message Tom Lane 2000-11-27 19:07:16 Re: [HACKERS] Indexing for geographic objects?