update! It looks that this has been reverted On 2nd of April 2018, Simon Riggs committed patch: MERGE SQL Command following SQL:2016 MERGE performs actions that modify rows in the target table using a source table or query. MERGE provides a single SQL statement that can ...

In previous post in the series I wrote about how to interpret single line in explain analyze output, it's structure, and later on described all basic data-getting operations (nodes in explain tree). Today, we'll move towards more complicated operations.

If you worked with certain other (than PostgreSQL) open source database, you might wonder why PostgreSQL doesn't have MERGE, and why UPSERT example in documentation is so complicated. Well, let's try to answer the question, and look into some alternatives.