The optional RETURNING clause causes MERGE
to compute and return value(s) based on each row inserted, updated, or
deleted. Any expression using the source or target table's columns, or
- the function can be computed. When an
- INSERT or UPDATE action is performed,
- the new values of the target table's columns are used. When a
- DELETE is performed, the old values of the target table's
- columns are used. The syntax of the RETURNING list is
- identical to that of the output list of SELECT.
+ the merge_action()
+ function can be computed. When an INSERT or
+ UPDATE action is performed, the new values of the target
+ table's columns are used. When a DELETE is performed,
+ the old values of the target table's columns are used. The syntax of the
+ RETURNING list is identical to that of the output list
+ of SELECT.
An expression to be computed and returned by the MERGE
command after each row is changed (whether inserted, updated, or deleted).
The expression can use any columns of the source or target tables, or the
- <xref linkend="merge_action"/> function to return additional information
- about the action executed.
+ <link linkend="merge-action">merge_action()
+ function to return additional information about the action executed.
Writing * will return all columns from the source