11<!--
2- $PostgreSQL: pgsql/doc/src/sgml/ref/create_trigger.sgml,v 1.47 2007/02/01 19:10:24 momjian Exp $
2+ $PostgreSQL: pgsql/doc/src/sgml/ref/create_trigger.sgml,v 1.48 2008/03/28 00:21:55 tgl Exp $
33PostgreSQL documentation
44-->
55
@@ -25,7 +25,7 @@ CREATE TRIGGER <replaceable class="PARAMETER">name</replaceable> { BEFORE | AFTE
2525 EXECUTE PROCEDURE <replaceable class="PARAMETER">funcname</replaceable> ( <replaceable class="PARAMETER">arguments</replaceable> )
2626</synopsis>
2727 </refsynopsisdiv>
28-
28+
2929 <refsect1>
3030 <title>Description</title>
3131
@@ -65,6 +65,12 @@ CREATE TRIGGER <replaceable class="PARAMETER">name</replaceable> { BEFORE | AFTE
6565 EACH STATEMENT</literal> triggers).
6666 </para>
6767
68+ <para>
69+ In addition, triggers may be defined to fire for a
70+ <command>TRUNCATE</command>, though only
71+ <literal>FOR EACH STATEMENT</literal>.
72+ </para>
73+
6874 <para>
6975 If multiple triggers of the same kind are defined for the same event,
7076 they will be fired in alphabetical order by name.
@@ -80,7 +86,7 @@ CREATE TRIGGER <replaceable class="PARAMETER">name</replaceable> { BEFORE | AFTE
8086 Refer to <xref linkend="triggers"> for more information about triggers.
8187 </para>
8288 </refsect1>
83-
89+
8490 <refsect1>
8591 <title>Parameters</title>
8692
@@ -110,10 +116,10 @@ CREATE TRIGGER <replaceable class="PARAMETER">name</replaceable> { BEFORE | AFTE
110116 <term><replaceable class="parameter">event</replaceable></term>
111117 <listitem>
112118 <para>
113- One of <command>INSERT</command>, <command>UPDATE</command>, or
114- <command>DELETE</command>; this specifies the event that will
115- fire the trigger. Multiple events can be specified using
116- <literal>OR</literal>.
119+ One of <command>INSERT</command>, <command>UPDATE</command>,
120+ <command>DELETE</command>, or <command>TRUNCATE</command>;
121+ this specifies the event that will fire the trigger. Multiple
122+ events can be specified using <literal>OR</literal>.
117123 </para>
118124 </listitem>
119125 </varlistentry>
@@ -179,6 +185,11 @@ CREATE TRIGGER <replaceable class="PARAMETER">name</replaceable> { BEFORE | AFTE
179185 <literal>TRIGGER</literal> privilege on the table.
180186 </para>
181187
188+ <para>
189+ Use <xref linkend="sql-droptrigger"
190+ endterm="sql-droptrigger-title"> to remove a trigger.
191+ </para>
192+
182193 <para>
183194 In <productname>PostgreSQL</productname> versions before 7.3, it was
184195 necessary to declare trigger functions as returning the placeholder
@@ -187,11 +198,6 @@ CREATE TRIGGER <replaceable class="PARAMETER">name</replaceable> { BEFORE | AFTE
187198 declared as returning <type>opaque</>, but it will issue a notice and
188199 change the function's declared return type to <type>trigger</>.
189200 </para>
190-
191- <para>
192- Use <xref linkend="sql-droptrigger"
193- endterm="sql-droptrigger-title"> to remove a trigger.
194- </para>
195201 </refsect1>
196202
197203 <refsect1 id="R1-SQL-CREATETRIGGER-2">
@@ -204,7 +210,7 @@ CREATE TRIGGER <replaceable class="PARAMETER">name</replaceable> { BEFORE | AFTE
204210
205211 <refsect1 id="SQL-CREATETRIGGER-compatibility">
206212 <title>Compatibility</title>
207-
213+
208214 <para>
209215 The <command>CREATE TRIGGER</command> statement in
210216 <productname>PostgreSQL</productname> implements a subset of the
@@ -267,6 +273,12 @@ CREATE TRIGGER <replaceable class="PARAMETER">name</replaceable> { BEFORE | AFTE
267273 <literal>OR</literal> is a <productname>PostgreSQL</> extension of
268274 the SQL standard.
269275 </para>
276+
277+ <para>
278+ The ability to fire triggers for <command>TRUNCATE</command> is a
279+ <productname>PostgreSQL</> extension of the SQL standard.
280+ </para>
281+
270282 </refsect1>
271283
272284 <refsect1>
0 commit comments