diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-11-20 20:38:12 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-11-20 20:38:12 +0000 |
commit | 7fc0f06221d22632daa3ff8b70919b43e8a242ca (patch) | |
tree | a2ec73a6256c30ba9cb2d4723868978c5136ba5e /src/include/commands/trigger.h | |
parent | 201a45c4fa23c485cf2e14ac9db8064b2c559fdc (diff) | |
download | postgresql-7fc0f06221d22632daa3ff8b70919b43e8a242ca.tar.gz postgresql-7fc0f06221d22632daa3ff8b70919b43e8a242ca.zip |
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.
Diffstat (limited to 'src/include/commands/trigger.h')
-rw-r--r-- | src/include/commands/trigger.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h index 2bf40b76af4..c461e706354 100644 --- a/src/include/commands/trigger.h +++ b/src/include/commands/trigger.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/commands/trigger.h,v 1.77 2009/10/26 02:26:41 tgl Exp $ + * $PostgreSQL: pgsql/src/include/commands/trigger.h,v 1.78 2009/11/20 20:38:11 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -104,7 +104,7 @@ extern PGDLLIMPORT int SessionReplicationRole; #define TRIGGER_FIRES_ON_REPLICA 'R' #define TRIGGER_DISABLED 'D' -extern Oid CreateTrigger(CreateTrigStmt *stmt, +extern Oid CreateTrigger(CreateTrigStmt *stmt, const char *queryString, Oid constraintOid, Oid indexOid, const char *prefix, bool checkPermissions); |