Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint
Date
Msg-id CANP8+j+03k40FjXY9kteUhfDKf8T_bnZNov-9P17fhXLrOUUdA@mail.gmail.com
Whole thread Raw
In response to Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint  (Geoff Winkless <pgsqladmin@geoff.dj>)
Responses Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint  (Geoff Winkless <pgsqladmin@geoff.dj>)
List pgsql-hackers
On 19 May 2015 at 11:49, Geoff Winkless <pgsqladmin@geoff.dj> wrote:
On 19 May 2015 at 16:32, I wrote:
In the event that the INSERT triggers a constraint that the UPDATE fails to resolve, it will still fail in exactly the same way that running the ON CONFLICT on a specific constraint would fail, so it's not like you gain any extra value from specifying the constraint, is it?

​I don't know why I wrote this paragraph, it's just the product of me thinking of something else at the same time:
 UPDATE obviously doesn't resolve a conflict as such.


Thinking about it more, I suppose if multiple constraints end up triggering for the same INSERT, it would require UPDATEs of multiple rows. Is that the issue?

I'm sure we'll be asked these questions many times. 

Can you comment on whether the docs are sufficiently detailed to explain this answer?

--
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

pgsql-hackers by date:

Previous
From: "Greg Sabino Mullane"
Date:
Subject: Re: Problems with question marks in operators (JDBC, ECPG, ...)
Next
From: Andrew Dunstan
Date:
Subject: Re: Problems with question marks in operators (JDBC, ECPG, ...)