Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}
Josh Berkus <josh@agliodbs.com>
From: Josh Berkus <josh@agliodbs.com>
To: Kevin Grittner <kgrittn@ymail.com>, Peter Geoghegan <pg@heroku.com>
Cc: Andres Freund <andres@2ndquadrant.com>,
Simon Riggs <simon@2ndquadrant.com>,
Heikki Linnakangas <hlinnakangas@vmware.com>,
Pg Hackers <pgsql-hackers@postgresql.org>,
Craig Ringer <craig@2ndquadrant.com>
Date: 2014-09-30T21:44:07Z
Lists: pgsql-hackers
On 09/30/2014 02:39 PM, Kevin Grittner wrote: > Josh Berkus <josh@agliodbs.com> wrote: >> On 09/30/2014 07:15 AM, Kevin Grittner wrote: > >>> At the risk of pushing people away from this POV, I'll point out >>> that this is somewhat similar to what we do for unlogged bulk loads >>> -- if all the conditions for doing it the fast way are present, we >>> do it the fast way; otherwise it still works, but slower. >> >> Except that switching between fast/slow bulk loads affects *only* the >> speed of loading, not the locking rules. Having a statement silently >> take a full table lock when we were expecting it to be concurrent >> (because, for example, the index got rebuilt and someone forgot the >> UNIQUE) violates POLA from my perspective. > > I would not think that an approach which took a full table lock to > implement the more general case would be accepted. Why not? There are certainly cases ... like bulk loading ... where users would find it completely acceptable. Imagine that you're merging 3 files into a single unlogged table before processing them into finished data. -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com
Commits
-
Change the way we mark tuples as frozen.
- 37484ad2aace 9.4.0 cited
-
Add documentation for data-modifying statements in WITH clauses.
- 0ef0b3020402 9.1.0 cited