On Fri, Oct 24, 2014 at 1:18 PM, Josh Berkus <j...@agliodbs.com> wrote: > On 10/24/2014 10:04 AM, Robert Haas wrote: >> As far as syntax goes, I thought the INSERT .. ON CONFLICT UPDATE >> syntax proposed upthread was the best of any mentioned thus far. The >> MERGE-based syntaxes proposed upthread were crazily verbose for no >> discernable benefit. > > For those of us who haven't followed every post in this thread, is there > somewhere I can see the proposed syntax?
There are a couple of different proposals but this should give you a feeling for where we're at: http://www.postgresql.org/message-id/CA+TgmoZN=2ajki1n4jz5bkmyi8r_cpudw+dtoppmtelvmso...@mail.gmail.com The part I like is the idea of making UPSERT look like an INSERT statement with an additional clause that says how a unique violation should be handled. The part nobody except Peter likes is using functional notation like CONFLICTING() or EXCLUDED() to pull in values from the tuple causing the unique violation. And there are some other areas of disagreement about particular keywords and so on. But I personally like that general style much more than the alternatives derived from MERGE. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers