Re: Truncate Triggers

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Truncate Triggers
Дата
Msg-id 24984.1201991920@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Truncate Triggers  (David Fetter <david@fetter.org>)
Ответы Re: Truncate Triggers
Список pgsql-hackers
David Fetter <david@fetter.org> writes:
> On Sat, Feb 02, 2008 at 05:23:39PM -0500, Christopher Browne wrote:
>> I think it would be nice to be able to have more "trigger hooks"
>> relating to DDL changes, but I also think that will represent some
>> fundamentally more difficult problems being raised than is the case
>> for a TRUNCATE trigger.

> Are they really?

One fairly obvious difficulty is how to pass the trigger any meaningful
information about what happened (or is about to happen).  In the case of
TRUNCATE, pretty much everything you need to know is implicit in the
event type.

I suspect that triggers on DDL will also share some of the problems
we've identified in past discussions about supporting triggers on system
catalogs --- in fact, to a first approximation these might be the same
thing.  It's not clear that we want to be firing random user-defined
code during the process of a catalog update, nor that it can be
guaranteed a consistent view of the system state.  TRUNCATE triggers
are a narrow enough case to dodge that complexity, or much of it anyway
(in a multi-table TRUNCATE there'd still be some interesting questions
about just when the triggers fire).
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: and waiting
Следующее
От: "Gurjeet Singh"
Дата:
Сообщение: Re: and waiting