Re: SQL MERGE is quite distinct from UPSERT - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: SQL MERGE is quite distinct from UPSERT
Date
Msg-id 53CCA822.4000809@2ndquadrant.com
Whole thread Raw
In response to SQL MERGE is quite distinct from UPSERT  (Peter Geoghegan <pg@heroku.com>)
Responses Re: SQL MERGE is quite distinct from UPSERT
List 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



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: SQL MERGE is quite distinct from UPSERT
Next
From: Peter Geoghegan
Date:
Subject: Re: SQL MERGE is quite distinct from UPSERT