Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
50ef9f7b
Commit
50ef9f7b
authored
15 years ago
by
Peter Eisentraut
Browse files
Options
Downloads
Patches
Plain Diff
Small wording improvement and clarification in PL/pgSQL trigger documentation
parent
0d399d57
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/src/sgml/plpgsql.sgml
+18
-8
18 additions, 8 deletions
doc/src/sgml/plpgsql.sgml
with
18 additions
and
8 deletions
doc/src/sgml/plpgsql.sgml
+
18
−
8
View file @
50ef9f7b
<!-- $PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.14
8
2009/12/
19 01:49:02 tgl
Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.14
9
2009/12/
28 19:11:51 petere
Exp $ -->
<chapter id="plpgsql">
<title><application>PL/pgSQL</application> - <acronym>SQL</acronym> Procedural Language</title>
...
...
@@ -3197,16 +3197,26 @@ RAISE unique_violation USING MESSAGE = 'Duplicate user ID: ' || user_id;
for this row). If a nonnull
value is returned then the operation proceeds with that row value.
Returning a row value different from the original value
of <varname>NEW</> alters the row that will be inserted or updated
(but has no direct effect in the <command>DELETE</> case).
To alter the row to be stored, it is possible to replace single values
directly in <varname>NEW</> and return the modified <varname>NEW</>,
or to build a complete new record/row to return.
of <varname>NEW</> alters the row that will be inserted or
updated. Thus, if the trigger function wants the triggering
action to succeed normally without altering the row
value, <varname>NEW</varname> (or a value equal thereto) has to be
returned. To alter the row to be stored, it is possible to
replace single values directly in <varname>NEW</> and return the
modified <varname>NEW</>, or to build a complete new record/row to
return. In the case of a before-trigger
on <command>DELETE</command>, the returned value has no direct
effect, but it has to be nonnull to allow the trigger action to
proceed. Note that <varname>NEW</varname> is null
in <command>DELETE</command> triggers, so returning that is
usually not sensible. A useful idiom in <command>DELETE</command>
triggers might be to return <varname>OLD</varname>.
</para>
<para>
The return value of a <literal>BEFORE</> or <literal>AFTER</>
statement-level trigger or an <literal>AFTER</> row-level trigger is
The return value of a row-level trigger
fired <literal>AFTER</literal> or a statement-level trigger
fired <literal>BEFORE</> or <literal>AFTER</> is
always ignored; it might as well be null. However, any of these types of
triggers might still abort the entire operation by raising an error.
</para>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment