News for hackers. Stuff that matters.
Re:Upsert Lands in PostgreSQL 9.5 – A First Look by jandrewrogers on Wednesday May 13, 2015 @12:16PM (#9540029)
The difficulty is supporting high concurrency AND correctness AND high performance with this feature. Most databases that have supported this in the past have sacrificed one of these; PostgreSQL requires an implementation with no impact to existing users and without weakening the guarantees people are used to.

In most good databases you can compose an upsert transactionally from a set of independent operations. The problem is that this is slow because you are plumbing the database engine multiple times for an operation that could be executed in one shot in principle. A native upsert implementation provides a fast, single operation. In the case of PostgreSQL though, they had to support this in the context of high-performance, high-concurrency, and correctness which makes it tricky because it is relatively complex to implement under those constraints.

Re:Upsert Lands in PostgreSQL 9.5 – A First Look by ryanjshaw on Wednesday May 13, 2015 @12:50PM (#9540229)
This implementation of upsert is especially nice because it is atomic [1]:

    <literal>ON CONFLICT DO UPDATE</literal> guarantees an atomic
    <command>INSERT</command> or <command>UPDATE</command> outcome - provided
    there is no independent error, one of those two outcomes is guaranteed,
    even under high concurrency.
I don't know about Oracle or MySQL, but the SQL Server implementation of MERGE requires you to carefully consider which locks to use and it's very easy to shoot yourself in the foot with.

[1] http://git.postgresql.org/gitweb/?p=postgresql.git;a=blobdif...