MERGE is supported since the recent PostgreSQL 15 version release. With this feature, you can perform a set of actions like DELETE/UPDATE/INSERT at the target table by comparing the target table with the source table or a query result. See more.
The UPSERT feature in PostgreSQL works only with the INSERT statement. That is, when there is a conflict while inserting data, you can either perform an UPDATE or do nothing. It only supports two actions whenever there is a conflict. Here, the trigger point of the UPDATE operation is the data conflict. See more.

Written by Bakul Banthia
Updated over a year ago