Re: Enhancement proposal - detect chain of triggers from inside the trigger - Mailing list pgsql-general

From Tom Lane
Subject Re: Enhancement proposal - detect chain of triggers from inside the trigger
Date
Msg-id 26296.1358353128@sss.pgh.pa.us
Whole thread Raw
In response to Re: Enhancement proposal - detect chain of triggers from inside the trigger  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Enhancement proposal - detect chain of triggers from inside the trigger
List pgsql-general
Pavel Stehule <pavel.stehule@gmail.com> writes:
> 2013/1/16 Edson Richter <edsonrichter@hotmail.com>:
>> I was wondering, would be a nice addition the ability to read the chain of
>> triggers (may be another trigger variable like TG_OP, called "TG_CHAIN" or
>> something else that will be an array with the name of the triggers called
>> before current trigger).

> -1

> building dynamic used array, that should or should not used can
> significantly decrease performance :(

I agree it wouldn't do to add cycles to every trigger for a feature that
only a small minority of them would use.  However, maybe we could expose
something like this as a function you'd call to get the information if
you want it, with nil-or-close-to-nil overhead if you don't.

In the long run, maybe some of the lesser-used existing trigger
variables should be converted to that style too ...

            regards, tom lane


pgsql-general by date:

Previous
From: Edson Richter
Date:
Subject: Triggers operations and log_statement = all not working?
Next
From: Rob Sargent
Date:
Subject: Re: SELECT * and column ordering