Proposal: TRUNCATE TABLE table RESTRICT

Поиск
Список
Период
Сортировка
Искать
От
Tatsuo Ishii
Тема
Proposal: TRUNCATE TABLE table RESTRICT
Дата
Msg-id
20000608212452H.t-ishii@sra.co.jp
Список
Дерево обсуждения
Re: Proposal: TRUNCATE TABLE table RESTRICT Mike Mascari <mascarm@mascari.com>
Re: Proposal: TRUNCATE TABLE table RESTRICT Don Baccus <dhogaza@pacifier.com>
It seems the truncate command deletes all rows from a table even it is
referenced by another tables. TRUNCATE is not in the standard any way,
so I would not claim this is a bug. However, sometimes it would be
helpful for a user to let him notice that the table about to be
truncated is referenced by some tables. So I would propose to add
"RESTRICT" option to the command. I mean if RESTRICT is specified,
TRUNCATE will fail if the table is referenced.

BTW, the keyword "RESTRICT" is inspired by the fact that DROP TABLE
has the same option according to the standard. If a table is
referenced by some tables and the drop table command has the RESTRICT
option, it would fail. This seems to be a nice feature too.

Comments?
--
Tatsuo Ishii

В списке pgsql-hackers по дате отправления
От: Mitch Vincent
Дата:
Сообщение: Strange message in logs..
От: Tatsuo Ishii
Дата:
Сообщение: Re: Back online
FAQ