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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers