Re: SQL MERGE is quite distinct from UPSERT

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Peter Geoghegan <pg(at)heroku(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SQL MERGE is quite distinct from UPSERT
Date: 2014-07-21 05:41:54
Message-ID: 53CCA822.4000809@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 07/20/2014 12:55 PM, Peter Geoghegan wrote:

> There is a *really* big
> demand for UPSERT from users, not MERGE, although MERGE is certainly
> useful too.

The inability to efficiently say "Add this unique-keyed row, or if a row
of the same key already exists replace it atomically" is a fundamental
defect in SQL its self. Vendors shouldn't need to be coming up with
their own versions because the standard should really cover this - much
like LIMIT and OFFSET.

It's very high in the most frequently asked questions on Stack Overflow,
right up there with questions about pg_hba.conf, connection issues on OS
X, etc.

I'd be very keen to see atomic upsert in Pg. Please Cc me on any patches
/ discussion, I'll be an eager tester.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2014-07-21 07:46:46 Re: SQL MERGE is quite distinct from UPSERT
Previous Message Craig Ringer 2014-07-21 05:40:47 Re: SQL MERGE is quite distinct from UPSERT