Re: Trigger with WHEN clause (WIP) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Trigger with WHEN clause (WIP)
Date
Msg-id 5572.1255701727@sss.pgh.pa.us
Whole thread Raw
In response to Re: Trigger with WHEN clause (WIP)  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Trigger with WHEN clause (WIP)
Re: Trigger with WHEN clause (WIP)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> On Fri, 2009-10-16 at 09:31 +0100, Simon Riggs wrote:
>> * It will reduce size of in-memory pending trigger list (for large
>> statements)

> But this won't be the outcome when it's implemented the way it is being
> proposed, which checks the where clause just before executing the
> trigger function.

Hm, the feature could actually be worth something if it allows
conditions to be checked before an AFTER trigger event gets pushed
into the event list.  However, if it's not doing that ...

I note BTW that we have some ad-hoc logic already that arranges to
suppress queuing of AFTER events for FK triggers, if the FK column
value has not changed.  It might be interesting to look at whether
that hack could be unified with the user-accessible feature.  It's
essentially a WHEN OLD.x IS NOT DISTINCT FROM NEW.x test.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Trigger with WHEN clause (WIP)
Next
From: Simon Riggs
Date:
Subject: Re: Trigger with WHEN clause (WIP)