From f8c0af840d84086249647d4415bd35903bfc7933 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 7 Mar 2011 16:00:36 -0500 Subject: [PATCH] Minor copy-editing in CREATE TRIGGER reference page. Per suggestions from Thom Brown and Robert Haas. --- doc/src/sgml/ref/create_trigger.sgml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/doc/src/sgml/ref/create_trigger.sgml b/doc/src/sgml/ref/create_trigger.sgml index e697ab6cc9..8e502d94e4 100644 --- a/doc/src/sgml/ref/create_trigger.sgml +++ b/doc/src/sgml/ref/create_trigger.sgml @@ -28,6 +28,13 @@ CREATE [ CONSTRAINT ] TRIGGER name [ FOR [ EACH ] { ROW | STATEMENT } ] [ WHEN ( condition ) ] EXECUTE PROCEDURE function_name ( arguments ) + +where event can be one of: + + INSERT + UPDATE [ OF column_name [, ... ] ] + DELETE + TRUNCATE @@ -212,24 +219,24 @@ CREATE [ CONSTRAINT ] TRIGGER name event - One of INSERT, UPDATE, - DELETE, or TRUNCATE; + One of INSERT, UPDATE, + DELETE, or TRUNCATE; this specifies the event that will fire the trigger. Multiple events can be specified using OR. - For UPDATE triggers, it is possible to + For UPDATE events, it is possible to specify a list of columns using this syntax: UPDATE OF column_name1 [, column_name2 ... ] The trigger will only fire if at least one of the listed columns - is mentioned as a target of the update. + is mentioned as a target of the UPDATE command. - UPDATE INSTEAD OF triggers do not support lists of columns. + INSTEAD OF UPDATE events do not support lists of columns. @@ -365,8 +372,8 @@ UPDATE OF column_name1 [, column_name2 - A column-specific trigger (FOR UPDATE OF - column_name) will fire when any + A column-specific trigger (one defined using the UPDATE OF + column_name syntax) will fire when any of its columns are listed as targets in the UPDATE command's SET list. It is possible for a column's value to change even when the trigger is not fired, because changes made to the -- GitLab