Re: DROP CASCADE transitive dependencies

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: DROP CASCADE transitive dependencies
Дата
Msg-id
2493.1543861586@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
DROP CASCADE transitive dependencies C GG <cgg0007@gmail.com>
Re: DROP CASCADE transitive dependencies Tom Lane <tgl@sss.pgh.pa.us>
Re: DROP CASCADE transitive dependencies C GG <cgg0007@gmail.com>
Re: DROP CASCADE transitive dependencies Alvaro Herrera <alvherre@2ndquadrant.com>
Re: DROP CASCADE transitive dependencies Pavel Stehule <pavel.stehule@gmail.com>
C GG  writes:
> ...PostgreSQL 9.5...
> `DROP SCHEMA blah;` reports all the dependent objects and advises to `DROP
> SCHEMA blah CASCADE;` ...

> Will DROP ... CASCADE traverse the entire dependency tree for each of the
> dependent objects (potentially dropping something unintended), or will it
> stop at the first level and balk at any new transitive dependencies?

The former.  However, the list of dependencies it's showing you as
potentially dropped already includes transitive dependencies; there
aren't going to be "new" ones unless somebody is adding things
concurrently.

If you're feeling paranoid, you could always do

begin;
drop ... cascade;

and then look at the reported list of objects before deciding whether
to commit or roll back.

			regards, tom lane

В списке pgsql-general по дате отправления
От: Stephen Frost
Дата:
От: C GG
Дата:
FAQ