PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.
MERGE can now use a RETURNING clause to return modified rows and what action was used to modify them using the merge_action() function.
RETURNING
merge_action()