Commit 2f6c8453 authored by Tom Lane's avatar Tom Lane

Fix erroneous documentation of the syntax of CREATE CONSTRAINT TRIGGER.

The grammar requires a specific ordering of the clauses, but the
documentation showed a different order.  This error was introduced in
commit b47953f9, which merged the CREATE
CONSTRAINT TRIGGER documentation into the CREATE TRIGGER page.  There is
no code bug AFAICS.
parent 7e49330c
...@@ -22,9 +22,10 @@ PostgreSQL documentation ...@@ -22,9 +22,10 @@ PostgreSQL documentation
<refsynopsisdiv> <refsynopsisdiv>
<synopsis> <synopsis>
CREATE [ CONSTRAINT ] TRIGGER <replaceable class="PARAMETER">name</replaceable> { BEFORE | AFTER | INSTEAD OF } { <replaceable class="PARAMETER">event</replaceable> [ OR ... ] } CREATE [ CONSTRAINT ] TRIGGER <replaceable class="PARAMETER">name</replaceable> { BEFORE | AFTER | INSTEAD OF } { <replaceable class="PARAMETER">event</replaceable> [ OR ... ] }
ON <replaceable class="PARAMETER">table</replaceable> [ FOR [ EACH ] { ROW | STATEMENT } ] ON <replaceable class="PARAMETER">table</replaceable>
[ FROM <replaceable class="parameter">referenced_table_name</replaceable> ] [ FROM <replaceable class="parameter">referenced_table_name</replaceable> ]
{ NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE | INITIALLY DEFERRED } } { NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE | INITIALLY DEFERRED } }
[ 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> )
</synopsis> </synopsis>
...@@ -518,8 +519,8 @@ CREATE TRIGGER view_insert ...@@ -518,8 +519,8 @@ CREATE TRIGGER view_insert
deletes fire <emphasis>after</> the cascaded <literal>DELETE</> completes. deletes fire <emphasis>after</> the cascaded <literal>DELETE</> completes.
The <productname>PostgreSQL</productname> behavior is for <literal>BEFORE The <productname>PostgreSQL</productname> behavior is for <literal>BEFORE
DELETE</literal> to always fire before the delete action, even a cascading DELETE</literal> to always fire before the delete action, even a cascading
one. This is considered more consistent. There is also unpredictable one. This is considered more consistent. There is also nonstandard
behavior when <literal>BEFORE</literal> triggers modify rows or prevent behavior if <literal>BEFORE</literal> triggers modify rows or prevent
updates during an update that is caused by a referential action. This can updates during an update that is caused by a referential action. This can
lead to constraint violations or stored data that does not honor the lead to constraint violations or stored data that does not honor the
referential constraint. referential constraint.
......
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