Re: trigger for TRUNCATE?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: trigger for TRUNCATE?
Дата
Msg-id 20080110174705.GO6465@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: trigger for TRUNCATE?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: trigger for TRUNCATE?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Tom Lane escribió:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
> > Gerardo Herzig escribi�:
> >> Yes, the TRUNCATE statement is not sql ansi, maybe is a more low level 
> >> thing than i think.
> 
> > TRUNCATE currently does not fire triggers, but that doesn't mean it's
> > impossible to do it.  I think it would be fairly easy to add support
> > for that.
> 
> The entire point of TRUNCATE is to not do a table scan, so making it
> fire per-row triggers seems pretty misguided to me.

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.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: trigger for TRUNCATE?
Следующее
От: Gerardo Herzig
Дата:
Сообщение: Re: trigger for TRUNCATE?