Re: UPSERT strange behavior - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: UPSERT strange behavior
Date
Msg-id CAM3SWZSB8RGrkYRCV5ahrOTOktUjnjQcKQeYKCK9x7W9-wWa1w@mail.gmail.com
Whole thread Raw
In response to UPSERT strange behavior  (Ivan Frolkov <ifrol2001@mail.ru>)
Responses Re: UPSERT strange behavior  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Aug 25, 2016 at 7:12 AM, Ivan Frolkov <ifrol2001@mail.ru> wrote:
> So, if we have primary key and unique constraint on a table then upsert will
> not work as would expected.

Why is this unexpected?

You only take the alternative path (UPDATE) in the event of a would-be
duplicate violation. You can't upsert while using more than one index
as an arbiter index. This is true unless they're more or less
equivalent, in which case multiple arbiter indexes can be inferred,
but that clearly doesn't apply here.


-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: increasing the default WAL segment size
Next
From: Robert Haas
Date:
Subject: Re: increasing the default WAL segment size