David Fetter <[EMAIL PROTECTED]> 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

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to