All Collections
PostgreSQL
Concepts
What is the difference between MERGE and UPSERT in PostgreSQL?
What is the difference between MERGE and UPSERT in PostgreSQL?
Bakul Banthia avatar
Written by Bakul Banthia
Updated over a week ago

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.

Did this answer your question?