7 comments

[ 1334 ms ] story [ 348 ms ] thread
This needs some comment on proper usage (locking, isolation, ...) of these to avoid deadlocks (one thread inserts, other updates at the same time, ...). Without this this incomplete and of limited use.
This doesn't actually go into the "implement" part. It just describes the syntax.

The implementation is very hard and why it wasn't in Postgresql until now.

i'd like to see an explanation of why this syntax was chosen instead of ANSI MERGE (http://en.wikipedia.org/wiki/Merge_%28SQL%29).
The semantics are slightly different - the Postgres command doesn't do the exact same thing. So rather have two identically named commands that do slightly different things, they picked a different syntax so it would be clear they aren't the same.