Re: trigger for TRUNCATE?

Поиск
Список
Период
Сортировка
От Chris Browne
Тема Re: trigger for TRUNCATE?
Дата
Msg-id 60tzloyr0u.fsf@dba2.int.libertyrms.com
обсуждение исходный текст
Ответ на trigger for TRUNCATE?  (Gerardo Herzig <gherzig@fmed.uba.ar>)
Ответы Re: trigger for TRUNCATE?  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Список pgsql-sql
gherzig@fmed.uba.ar (Gerardo Herzig) writes:
> Hi all. Acording to the docs, TRUNCATE will not fire a DELETE trigger
> on the table being truncated.
> There is a way to capture a TRUNCATE in any way?

I think there's some sort of "to do" on that...

It ought to be not *too* difficult (I imagine!) to be able to
associate a trigger with the TRUNCATE action, and therefore run some
stored function any time TRUNCATE takes place.

For the Slony-I replication system, it would be attractive for this to
lead to attaching two functions: - One function would return an exception so that TRUNCATE against   a subscriber node
wouldfail...
 
 - Another would pretty much be as simple as submitting an event;   perform createEvent('_ourcluster',
'TRUNCATE_TABLE',table_id);
 

A new event, TRUNCATE_TABLE, would do a TRUNCATE against the
subscribers.

This represents a pretty easy enhancement, given the new kind of
trigger.
-- 
(reverse (concatenate 'string "moc.enworbbc" "@" "enworbbc"))
http://www3.sympatico.ca/cbbrowne/nonrdbms.html
Frisbeetarianism: The belief that when  you die, your  soul goes up on
the roof and gets stuck...


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

Предыдущее
От: "Jamie Tufnell"
Дата:
Сообщение: Re: How to keep at-most N rows per group? periodic DELETEs or constraints or..?
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: trigger for TRUNCATE?