Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>, Peter Geoghegan <pg(at)heroku(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Craig Ringer <craig(at)2ndquadrant(dot)com>
Subject: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}
Date: 2014-09-30 21:39:45
Message-ID: 1412113185.72905.YahooMailNeo@web122301.mail.ne1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Josh Berkus <josh(at)agliodbs(dot)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.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-09-30 21:43:03 Re: CREATE IF NOT EXISTS INDEX
Previous Message Fabrízio de Royes Mello 2014-09-30 21:20:01 CREATE IF NOT EXISTS INDEX