Re: Undocumented behavior od DROP SCHEMA ... CASCADE

Поиск
Список
Период
Сортировка
От Vik Fearing
Тема Re: Undocumented behavior od DROP SCHEMA ... CASCADE
Дата
Msg-id 7aeb5291-b9ca-3a3c-0bd8-e60b56ec2693@2ndquadrant.fr
обсуждение исходный текст
Ответ на Re: Undocumented behavior od DROP SCHEMA ... CASCADE  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: Undocumented behavior od DROP SCHEMA ... CASCADE  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-docs
On 12/08/16 14:47, Peter Eisentraut wrote:
> On 8/5/16 6:48 AM, denisa.cirstescu@asentinel.com wrote:
>> Page: https://www.postgresql.org/docs/9.5/static/sql-dropschema.html
>> Description:
>>
>> DROP SCHEMA ... CASCADE has a behavior that has not been documented.
>> According to the documentation: "CASCADE - Automatically drop objects
>> (tables, functions, etc.) that are contained in the schema.".
>> Well, besides this, DROP SCHEMA ... CASCADE also drops all the views which
>> depends on the schema that is being dropped. It does not matter if the views
>> are in the public schema or another schema than the one being dropped, they
>> are deleted.
>
> Can you give an example?

vik=# create schema a create table t (id int);
CREATE SCHEMA
vik=# create schema b create view v as select * from a.t;
CREATE SCHEMA
vik=# drop schema a cascade;
NOTICE:  drop cascades to 2 other objects
DETAIL:  drop cascades to table a.t
drop cascades to view b.v
DROP SCHEMA

I think the OP is complaining that cascading to b.v is not sufficiently
documented.  It seems logical to me that this would be the correct
behavior, but since at least one person got confused enough about it to
come and tell us, we should probably add some kind of warning or something.
--
Vik Fearing                                          +33 6 46 75 15 36
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Undocumented behavior od DROP SCHEMA ... CASCADE
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Undocumented behavior od DROP SCHEMA ... CASCADE