Hacker News new | ask | show | jobs
by ptrwis 1350 days ago
At least for some cases, there was a workaround by using INSERT ... ON CONFLICT
1 comments

I would argue that INSERT ... ON CONFLICT is not just a workaround but the correct solution in most cases. It is very explicit about what you want and makes sure that either it can take the correct locks or it will error out if there is no unique index/primary key that it can use to take the lock. But, yes, MERGE can do more things than INSERT ... ON CONFLICT.