Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: hlinnaka <hlinnaka(at)iki(dot)fi>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Date: 2015-05-06 18:27:49
Message-ID: CAM3SWZS286JSBHWpikt3=cKsgaDOmKe5vNWefbW04za6gyn5hA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

On Tue, May 5, 2015 at 10:31 AM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> Another thing I'm wondering about is dealing with deferrable
> constraints/deferred indexes.
>
> a) Why does ExecCheckIndexConstraints() check for indisimmediate for
> *all* indexes and not just when it's an arbiter index? That seems
> needlessly restrictive.

I guess it's a legacy of the time when it was all or nothing. But
supporting that would involve further complicating the interface with
ExecCheckIndexConstraints() so that we cared about the distinction
between conflicts for one purpose and conflicts for another. It could
be done, though.

> b) There's a doc addition to set_constraints.sgml
> + constraints are affected by this setting. Note that constraints
> + that are <literal>DEFERRED</literal> cannot be used as arbiters by
> + the <literal>ON CONFLICT</> clause that <command>INSERT</>
> + supports.
>
> which I don't think makes sense: SET CONSTRAINTS will never change
> anything relevant for ON CONFLICT, right?

You're right.

--
Peter Geoghegan

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Peter Geoghegan 2015-05-06 19:47:43 Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Previous Message Natalie Wenz 2015-05-06 18:11:08 pg_dump: preserving oids in system tables?

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2015-05-06 18:39:00 Re: Manipulating complex types as non-contiguous structures in-memory
Previous Message Peter Eisentraut 2015-05-06 17:56:26 Re: Disabling trust/ident authentication configure option