Add a WHEN clause to CREATE TRIGGER, allowing a boolean expression to be

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 7fc0f06221d22632daa3ff8b70919b43e8a242ca
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2009-11-20T20:38:12Z
Releases: 9.0.0
Add a WHEN clause to CREATE TRIGGER, allowing a boolean expression to be
checked to determine whether the trigger should be fired.

For BEFORE triggers this is mostly a matter of spec compliance; but for AFTER
triggers it can provide a noticeable performance improvement, since queuing of
a deferred trigger event and re-fetching of the row(s) at end of statement can
be short-circuited if the trigger does not need to be fired.

Takahiro Itagaki, reviewed by KaiGai Kohei.

Files