Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit469150a

Browse files
committed
Doc: clarify how triggers relate to transactions.
Laurenz Albe, per gripe from Nathan Long.Discussion:https://postgr.es/m/161953360822.695.15805897835151971142@wrigleys.postgresql.org
1 parent2dc53fe commit469150a

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

‎doc/src/sgml/ref/create_trigger.sgml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ CREATE [ OR REPLACE ] [ CONSTRAINT ] TRIGGER <replaceable class="parameter">name
175175
</para>
176176

177177
<para>
178+
<indexterm>
179+
<primary>trigger</primary>
180+
<secondary>constraint trigger</secondary>
181+
</indexterm>
178182
When the <literal>CONSTRAINT</literal> option is specified, this command creates a
179183
<firstterm>constraint trigger</firstterm>. This is the same as a regular trigger
180184
except that the timing of the trigger firing can be adjusted using

‎doc/src/sgml/trigger.sgml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,15 @@
122122
row in the view is identified as needing to be operated on.
123123
</para>
124124

125+
<para>
126+
The execution of an <literal>AFTER</literal> trigger can be deferred
127+
to the end of the transaction, rather than the end of the statement,
128+
if it was defined as a <firstterm>constraint trigger</firstterm>.
129+
In all cases, a trigger is executed as part of the same transaction as
130+
the statement that triggered it, so if either the statement or the
131+
trigger causes an error, the effects of both will be rolled back.
132+
</para>
133+
125134
<para>
126135
A statement that targets a parent table in an inheritance or partitioning
127136
hierarchy does not cause the statement-level triggers of affected child

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp