Commit f8c0af84 authored by Tom Lane's avatar Tom Lane

Minor copy-editing in CREATE TRIGGER reference page.

Per suggestions from Thom Brown and Robert Haas.
parent 1a4ab9ec
...@@ -28,6 +28,13 @@ CREATE [ CONSTRAINT ] TRIGGER <replaceable class="PARAMETER">name</replaceable> ...@@ -28,6 +28,13 @@ CREATE [ CONSTRAINT ] TRIGGER <replaceable class="PARAMETER">name</replaceable>
[ FOR [ EACH ] { ROW | STATEMENT } ] [ FOR [ EACH ] { ROW | STATEMENT } ]
[ WHEN ( <replaceable class="parameter">condition</replaceable> ) ] [ WHEN ( <replaceable class="parameter">condition</replaceable> ) ]
EXECUTE PROCEDURE <replaceable class="PARAMETER">function_name</replaceable> ( <replaceable class="PARAMETER">arguments</replaceable> ) EXECUTE PROCEDURE <replaceable class="PARAMETER">function_name</replaceable> ( <replaceable class="PARAMETER">arguments</replaceable> )
<phrase>where <replaceable class="parameter">event</replaceable> can be one of:</phrase>
INSERT
UPDATE [ OF <replaceable class="parameter">column_name</replaceable> [, ... ] ]
DELETE
TRUNCATE
</synopsis> </synopsis>
</refsynopsisdiv> </refsynopsisdiv>
...@@ -212,24 +219,24 @@ CREATE [ CONSTRAINT ] TRIGGER <replaceable class="PARAMETER">name</replaceable> ...@@ -212,24 +219,24 @@ CREATE [ CONSTRAINT ] TRIGGER <replaceable class="PARAMETER">name</replaceable>
<term><replaceable class="parameter">event</replaceable></term> <term><replaceable class="parameter">event</replaceable></term>
<listitem> <listitem>
<para> <para>
One of <command>INSERT</command>, <command>UPDATE</command>, One of <literal>INSERT</literal>, <literal>UPDATE</literal>,
<command>DELETE</command>, or <command>TRUNCATE</command>; <literal>DELETE</literal>, or <literal>TRUNCATE</literal>;
this specifies the event that will fire the trigger. Multiple this specifies the event that will fire the trigger. Multiple
events can be specified using <literal>OR</literal>. events can be specified using <literal>OR</literal>.
</para> </para>
<para> <para>
For <command>UPDATE</command> triggers, it is possible to For <literal>UPDATE</literal> events, it is possible to
specify a list of columns using this syntax: specify a list of columns using this syntax:
<synopsis> <synopsis>
UPDATE OF <replaceable>column_name1</replaceable> [, <replaceable>column_name2</replaceable> ... ] UPDATE OF <replaceable>column_name1</replaceable> [, <replaceable>column_name2</replaceable> ... ]
</synopsis> </synopsis>
The trigger will only fire if at least one of the listed columns 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 <command>UPDATE</> command.
</para> </para>
<para> <para>
<literal>UPDATE INSTEAD OF</> triggers do not support lists of columns. <literal>INSTEAD OF UPDATE</> events do not support lists of columns.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -365,8 +372,8 @@ UPDATE OF <replaceable>column_name1</replaceable> [, <replaceable>column_name2</ ...@@ -365,8 +372,8 @@ UPDATE OF <replaceable>column_name1</replaceable> [, <replaceable>column_name2</
</para> </para>
<para> <para>
A column-specific trigger (<literal>FOR UPDATE OF A column-specific trigger (one defined using the <literal>UPDATE OF
<replaceable>column_name</replaceable></literal>) will fire when any <replaceable>column_name</replaceable></literal> syntax) will fire when any
of its columns are listed as targets in the <command>UPDATE</> of its columns are listed as targets in the <command>UPDATE</>
command's <literal>SET</> list. It is possible for a column's value command's <literal>SET</> list. It is possible for a column's value
to change even when the trigger is not fired, because changes made to the to change even when the trigger is not fired, because changes made to the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment