DROP TABLE, and children?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема DROP TABLE, and children?
Дата
Msg-id Pine.LNX.4.21.0011211717570.2053-100000@aguila.protecne.cl
обсуждение исходный текст
Список pgsql-general
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[@]protecne.cl>)


В списке pgsql-general по дате отправления:

Предыдущее
От: Larry Rosenman
Дата:
Сообщение: Re: Trying to build 7.0.3 on SCO 5.0.4
Следующее
От: Dave Smith
Дата:
Сообщение: Re: Trying to build 7.0.3 on SCO 5.0.4