pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Nikolay Samokhvalov <samokhvalov@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: ON CONFLICT with constraint name doesn't work
Date: Thu, 16 Mar 2017 12:49:08 -0700
Message-ID: <20170316194908.5ffknrbpe6ijsze2@alap3.anarazel.de> (raw)
In-Reply-To: <CAH2-Wzn-uXcLgC5uFbqe2rUfmJWP9AxKnMKAEgqU26hbURxk5A@mail.gmail.com>
References: <CANNMO++7+uVMj+ZPGKB_zuRpKE0sNthy2Z-_oKSS=oE3_rN7QA@mail.gmail.com>
	<20920c13-784f-05b5-6f86-dac31dc1d970@iki.fi>
	<CAH2-Wzn-uXcLgC5uFbqe2rUfmJWP9AxKnMKAEgqU26hbURxk5A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 2017-03-16 12:44:23 -0700, Peter Geoghegan wrote:
> On Thu, Mar 16, 2017 at 12:42 PM, Heikki Linnakangas <hlinnaka@iki.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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (12+ messages)  latest in thread

Message-ID: <20170316194908.5ffknrbpe6ijsze2@alap3.anarazel.de>
Permalink:  ../20170316194908.5ffknrbpe6ijsze2@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20170316194908.5ffknrbpe6ijsze2@alap3.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andres@anarazel.de, pg@bowt.ie, hlinnaka@iki.fi, samokhvalov@gmail.com
  Subject: Re: ON CONFLICT with constraint name doesn't work
  In-Reply-To: <20170316194908.5ffknrbpe6ijsze2@alap3.anarazel.de>
  References: <CANNMO++7+uVMj+ZPGKB_zuRpKE0sNthy2Z-_oKSS=oE3_rN7QA@mail.gmail.com> <20920c13-784f-05b5-6f86-dac31dc1d970@iki.fi> <CAH2-Wzn-uXcLgC5uFbqe2rUfmJWP9AxKnMKAEgqU26hbURxk5A@mail.gmail.com> <20170316194908.5ffknrbpe6ijsze2@alap3.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox