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

From: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Date: 2015-05-08 16:06:06
Message-ID: CAEzk6feoR301g57YOmbpVzx+49sTS_2w_Qq2DKzu0u6bKRf4YQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

On 8 May 2015 at 16:51, Andres Freund <andres(at)anarazel(dot)de> wrote:

> On 2015-05-08 16:36:07 +0100, Geoff Winkless wrote:
> > I thought the previous version suggested multiple possible targets and
> > actions, this suggests that while there can be multiple targets the
> > action is always the same.
>
> I don't think any version of the patch included that functionality. I
> can see it being useful, but it'd make a bunch of things more
> complicated, so I doubt we'll get there for 9.5.
>

​I'm not particularly bothered by it - I only see it ever being useful on
the extreme edge case, and
I certainly wouldn't want
​it
to hold up the release - but it was the only reason I could see for
requiring a target_clause in the first place (I
​expect that's why I
misread the docs previously!). If you can't specify different actions based
on the target_clause, what's the point in forcing the user to enumerate it?

> example (or similar); do we think people will be smart enough to realise
> > that's possible without one?​
>
> Hm. I'm tempted to say that the synopis makes that clear enough.

​Unless I'm missing it, it's really only in "This happens on a row-by-row
basis" and in the "deterministic" paragraph that you even mention
multi-line inserts in the ON CONFLICT section.​
​​

> I
> ​ ​
> personally never check such examples though, so maybe I'm the wrong
> person to judge.
>

​I'm afraid I'm the sort of person who goes straight to the examples :)

Maybe I'll just suggest then that there's a _potential for confusion_ if
you only give examples of the first kind - people might place some
inference on the fact that the examples only show single-row INSERTs.

Geoff

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message David G. Johnston 2015-05-08 16:16:48 Re: Schema Consolidation in PostgreSQL
Previous Message Andres Freund 2015-05-08 15:51:30 Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-05-08 16:32:10 Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Previous Message Andres Freund 2015-05-08 15:51:30 Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0