Conversation

MERGE is most noticeable, but will we prefer it over INSERT … ON CONFLICT, given the fact that it lacks RETURNING and, most importantly, it will be failing with errors when multiple sessions target the same rows? Does it have good use cases except migration from ora/ms?
Quote Tweet
Pretty sure this is the feature everyone is most excited about with Postgres 15 - MERGE crunchydata.com/blog/a-look-at
3
5
It seems like it should usually be easy to decide if you should use MERGE, or prefer ON CONFLICT. It comes down to this: do you want to do an upsert, or something more general? ON CONFLICT offers extra guarantees (even in READ COMMITTED), at the cost of some generality.
2
6
Arguably MERGE has race conditions, but context/expectations are important. Has race conditions relative to what? With what transaction isolation level, under what circumstances? You can have the same race conditions with multiple statements, too.
2