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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Josh Berkus <josh(at)agliodbs(dot)com>, Kevin Grittner <kgrittn(at)ymail(dot)com>, Andres Freund <andres(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-10-24 17:04:02
Message-ID: CA+TgmoZ9DNJdj4Y8F74NRvR4p7mWooZWDseiDREwwYCz+kv_Dw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 23, 2014 at 9:43 PM, Peter Geoghegan <pg(at)heroku(dot)com> wrote:
> * CONFLICTING() is renamed to EXCLUDED(). I know that some people
> wanted me to go a different way with this. I think that there are very
> good practical reasons not to [1], as well as good reasons related to
> design, but I still accept that CONFLICTING() isn't very descriptive.
> This spelling seems a lot better.

Specifically, "some people" included at least three committers and at
least one other community member no less prominent than yourself, or
in other words, every single person who bothered to comment. You can
think whatever you like; the chances of it being committed that way
are zero.

> Unique index inference (i.e. the way we figure out *which* unique
> index to use) occurs during parse analysis. I think it would be
> inappropriate, and certainly inconvenient to do it during planning.

You're wrong. The choice of which index to use is clearly wildly
inappropriately placed in the parse analysis phase, and if you think
that has any chance of ever being committed by anyone, then you are
presuming the existence of a committer who won't mind ignoring the
almost-immediate revert request that would draw from, at the very
least, Tom.

As far as syntax goes, I thought the INSERT .. ON CONFLICT UPDATE
syntax proposed upthread was the best of any mentioned thus far. The
MERGE-based syntaxes proposed upthread were crazily verbose for no
discernable benefit.

As much as I'd like to have this feature, your refusal to change
anything except when asked at least three times each by about five
different people makes this effort barely worth pursuing. You can say
all you like that you're receptive to feedback, but multiple people
here are telling you that they feel otherwise.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2014-10-24 17:13:09 Re: pg_background (and more parallelism infrastructure patches)
Previous Message Robert Haas 2014-10-24 16:42:15 Re: Question about RI checks