Re: trigger for TRUNCATE?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: trigger for TRUNCATE?
Дата
Msg-id 478727C3.3090301@archonet.com
обсуждение исходный текст
Ответ на Re: trigger for TRUNCATE?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: trigger for TRUNCATE?  (Erik Jones <erik@myemma.com>)
Re: trigger for TRUNCATE?  (Simon Riggs <simon@2ndquadrant.com>)
Список pgsql-sql
Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
>> My thinking is that a TRUNCATE trigger is a per-statement trigger which
>> doesn't have access to the set of deleted rows (Replicator uses it that
>> way -- we replicate the truncate action, and replay it on the replica).
>> In that way it would be different from a per-statement trigger for
>> DELETE.
> 
> Ah, right.  I was thinking in terms of having TRUNCATE actually fire the
> existing ON DELETE-type triggers, but that's not really helpful --- you'd
> need a separate trigger-event type.  So we could just say by fiat that
> an ON TRUNCATE trigger doesn't get any rowset information, even after we
> add that for the other types of statement-level triggers.

I've always considered TRUNCATE to be DDL rather than DML. I mentally 
group it with DROP TABLE rather than DELETE>

--   Richard Huxton  Archonet Ltd


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

Предыдущее
От: "Rajesh Kumar Mallah"
Дата:
Сообщение: Re: (possible) bug with constraint exclusion
Следующее
От: Gerardo Herzig
Дата:
Сообщение: Re: SQL stored function inserting and returning data in a row.