> prior to Postgres 15, you could use the "upsert" method with the ON CONFLICTclause.
> Now, MERGE can be used instead!
No mention of deadlocks in the article has me worried about thoroughness of the analysis.
> Now, MERGE can be used instead!
No mention of deadlocks in the article has me worried about thoroughness of the analysis.
In the Postgres community, MERGE has been talked about for a long time, but in my understanding, part of the reason why the Postgres team initially shipped INSERT ... ON CONFLICT (instead of straight up MERGE) is that it lets you have guarantees about the outcome of the statement (i.e. either INSERT or UPDATE, by use of speculative insertion handling), vs MERGE can cause unique constraint violations and other issues.
AFAIK, the generic syntax of MERGE does not allow for stricter guarantees, and therefore there will always be cases where one is better than the other.