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()