Skip to content

Commit 2f6c845

Browse files
committed
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 b47953f, which merged the CREATE CONSTRAINT TRIGGER documentation into the CREATE TRIGGER page. There is no code bug AFAICS.
1 parent 7e49330 commit 2f6c845

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/src/sgml/ref/create_trigger.sgml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ PostgreSQL documentation
2222
<refsynopsisdiv>
2323
<synopsis>
2424
CREATE [ CONSTRAINT ] TRIGGER <replaceable class="PARAMETER">name</replaceable> { BEFORE | AFTER | INSTEAD OF } { <replaceable class="PARAMETER">event</replaceable> [ OR ... ] }
25-
ON <replaceable class="PARAMETER">table</replaceable> [ FOR [ EACH ] { ROW | STATEMENT } ]
25+
ON <replaceable class="PARAMETER">table</replaceable>
2626
[ FROM <replaceable class="parameter">referenced_table_name</replaceable> ]
2727
{ NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE | INITIALLY DEFERRED } }
28+
[ FOR [ EACH ] { ROW | STATEMENT } ]
2829
[ WHEN ( <replaceable class="parameter">condition</replaceable> ) ]
2930
EXECUTE PROCEDURE <replaceable class="PARAMETER">function_name</replaceable> ( <replaceable class="PARAMETER">arguments</replaceable> )
3031
</synopsis>
@@ -518,8 +519,8 @@ CREATE TRIGGER view_insert
518519
deletes fire <emphasis>after</> the cascaded <literal>DELETE</> completes.
519520
The <productname>PostgreSQL</productname> behavior is for <literal>BEFORE
520521
DELETE</literal> to always fire before the delete action, even a cascading
521-
one. This is considered more consistent. There is also unpredictable
522-
behavior when <literal>BEFORE</literal> triggers modify rows or prevent
522+
one. This is considered more consistent. There is also nonstandard
523+
behavior if <literal>BEFORE</literal> triggers modify rows or prevent
523524
updates during an update that is caused by a referential action. This can
524525
lead to constraint violations or stored data that does not honor the
525526
referential constraint.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy