Re: Truncate Triggers

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Truncate Triggers
Дата
Msg-id 9031.1201980220@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Truncate Triggers  (David Fetter <david@fetter.org>)
Ответы Re: Truncate Triggers  (David Fetter <david@fetter.org>)
Список pgsql-hackers
David Fetter <david@fetter.org> writes:
> On Thu, Jan 31, 2008 at 10:22:42AM +0000, Gregory Stark wrote:
>> There are plenty of DDL commands which modify data (CREATE INDEX,
>> ATLER TABLE ALTER COLUMN TYPE). The defining characteristic of DDL
>> is not that it doesn't modify the data but that it does modify the
>> table definition.

> Counter-example: ALTER TABLE ALTER COLUMN USING will almost certainly
> modify data, but it's DDL nonetheless.

Uh, how is that a counter-example to what Greg said?


I think the real question here is whether there is a defensible use-case
for a trigger.  In the case of TRUNCATE it's pretty obvious what you
might want the trigger for: to do the same thing your per-row ON DELETE
trigger does, but across all rows.  It's much less easy to envision a
scriptable-in-advance response to arbitrary ALTER TABLE operations.

Looked at in this light, TRUNCATE is clearly more nearly DML than DDL,
in the sense that its effects are predictable and involve only the data
not the schema (at least in the user's view).
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: configurability of OOM killer
Следующее
От: "Florian G. Pflug"
Дата:
Сообщение: Re: configurability of OOM killer