Обсуждение: DROP CASCADE

Поиск
Список
Период
Сортировка

DROP CASCADE

От
Andreas
Дата:
Hi
I encountered something that puzzled me a bit.
Is it expected that DROP table CASCADE drops this table and just the
foreign key constraints but not the refering tables?

PG 9.2.1 on WinXP


Re: DROP CASCADE

От
Szymon Guz
Дата:
On 29 September 2012 18:08, Andreas <maps.on@gmx.net> wrote:
Hi
I encountered something that puzzled me a bit.
Is it expected that DROP table CASCADE drops this table and just the foreign key constraints but not the refering tables?

PG 9.2.1 on WinXP



Hi Andreas,
yes, it is expected, at least according to the documentation: http://www.postgresql.org/docs/9.1/static/ddl-depend.html 

"In this case, it doesn't remove the orders table, it only removes the foreign key constraint."

- Szymon