Re: Need "InBetween" (not just Before and After) Trigger - Mailing list pgsql-general

From Tom Lane
Subject Re: Need "InBetween" (not just Before and After) Trigger
Date
Msg-id 28270.979594212@sss.pgh.pa.us
Whole thread Raw
In response to Re: Need "InBetween" (not just Before and After) Trigger  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> Sort of, but it still isn't sufficient.  There's no way to say for certain
> that a later deferred trigger won't send an exception that will roll back
> the transaction.  What he'd really need would be something that occurs
> after the deferred trigger queue and after the transaction has committed
> that cannot cause the transaction to rollback (I'm not sure what an
> error condition raised in such a state would do...)

Good point.  One possibility is to do the external action outside the
database, perhaps in a daemon process that's listening for NOTIFYs sent
by the trigger.  (NOTIFY events are delivered only if the transaction
commits.)  You'd need some additional tables to record the actions the
daemon is supposed to take, since NOTIFY alone can't carry much of an
information payload.

            regards, tom lane

pgsql-general by date:

Previous
From: "Anthony E . Greene"
Date:
Subject: Re: Date help
Next
From: "Mike Miller"
Date:
Subject: Re: problem running initdb