Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint

From: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint
Date: 2015-05-20 09:49:14
Message-ID: CAEzk6fd1VCy_E-N_RgyNRNJctr_Jp=2DOCSPc-gCFkx0xZUtEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 19 May 2015 at 21:57, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:

> It's not clear to me how a single INSERT could cause two or more UPDATEs.
>


CREATE TABLE mytable (
c1 int NOT NULL,
c2 int NOT NULL,
PRIMARY KEY (c1),
UNIQUE (c2)​

​);

INSERT INTO mytable (c1, c2) (10, 20);​
INSERT INTO mytable (c1, c2) (11, 21);
​INSERT INTO mytable (c1, c2) (10, 21) ON CONFLICT DO UPDATE .....

Or did you mean from a coding point of view how it would be possible to
implement?

​Geoff​

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabrízio de Royes Mello 2015-05-20 11:06:22 Re: Change pg_cancel_*() to ignore current backend
Previous Message Etsuro Fujita 2015-05-20 09:40:37 Typo in tablecmds.c