Re: ON CONFLICT with constraint name doesn't work

From: Andres Freund <andres(at)anarazel(dot)de>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: ON CONFLICT with constraint name doesn't work
Date: 2017-03-16 19:49:08
Message-ID: 20170316194908.5ffknrbpe6ijsze2@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 2017-03-16 12:44:23 -0700, Peter Geoghegan wrote:
> On Thu, Mar 16, 2017 at 12:42 PM, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
> > We debated this for a long time when the ON CONFLICT feature was being
> > developed. In the end, we settled on this behavior, on the grounds that a
> > constraint is a logical concept, while an index is a physical implementation
> > detail. Note that the SQL standard also doesn't say anything about indexes,
> > but constraints are in the standard.
>
> Right. Besides, you really are only supposed to use the ON CONSTRAINT
> syntax when inference won't work, as an escape hatch. This doesn't
> look like an example of where inference won't work. That's limited to
> ON CONFLICT DO NOTHING with exclusion constraints, which is fairly
> limited.

FWIW, I never was completely on board with this design goal, and I think
we should have (and still should) support using indexes directly.

- Andres

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Geoghegan 2017-03-16 19:51:18 Re: ON CONFLICT with constraint name doesn't work
Previous Message Peter Geoghegan 2017-03-16 19:44:23 Re: ON CONFLICT with constraint name doesn't work

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2017-03-16 19:51:18 Re: ON CONFLICT with constraint name doesn't work
Previous Message Peter Geoghegan 2017-03-16 19:44:23 Re: ON CONFLICT with constraint name doesn't work