Re: How to fire triggers just on "top" level DML

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: "A(dot)M(dot)" <agentm(at)themactionfaction(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: How to fire triggers just on "top" level DML
Date: 2011-01-19 22:53:34
Message-ID: 28828.1295477614@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
> "A.M." <agentm(at)themactionfaction(dot)com> wrote:
>> Most PLs include some session-specific storage. In PL/Perl, it is
>> %_SHARED. Setting a flag there should do the trick. If you are
>> using a PL which does not have such a notion (like plpgsql), you
>> can add a call in your triggers to a function written in a PL
>> which does support this. Alternatively, a C function which
>> sets/checks a global flag would work as well.

> I thought it might come to that.

Correctly resetting such a value after a transaction/subtransaction
abort might be a bit problematic.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2011-01-19 22:54:52 Re: ERROR: index row requires 9984 bytes, maximum size is 8191
Previous Message Robert Fitzpatrick 2011-01-19 22:53:16 key=value imports