Re: INSERT ... ON CONFLICT {UPDATE | IGNORE} - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}
Date
Msg-id 54280587.30404@2ndquadrant.com
Whole thread Raw
In response to Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
On 09/28/2014 03:40 PM, Peter Geoghegan wrote:
> Do you really think I could get an entire chapter out of this?

Yes. It might be a short chapter, but once you extract the existing
upsert example from the docs and how why the naïve approach doesn't work
there'll be enough to go on.

People get this wrong a *lot*.

http://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING
http://www.depesz.com/2012/06/10/why-is-upsert-so-complicated/
http://stackoverflow.com/q/17267417/398670
http://stackoverflow.com/q/1109061/398670

I'm happy to help with documenting it.

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



pgsql-hackers by date:

Previous
From: Andreas Karlsson
Date:
Subject: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}
Next
From: Andres Freund
Date:
Subject: Re: Patch to support SEMI and ANTI join removal