Re: [PATCH] Make ON CONFLICT DO NOTHING and ON CONFLICT DO UPDATE consistent - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: [PATCH] Make ON CONFLICT DO NOTHING and ON CONFLICT DO UPDATE consistent
Date
Msg-id CAH2-Wz=T-pdQNo0k7-+FQxs3OcMVP3Td1NhZ0n3afP1C-g=4Ag@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Make ON CONFLICT DO NOTHING and ON CONFLICT DO UPDATE consistent  (Aleksander Alekseev <aleksander@timescale.com>)
Responses Re: [PATCH] Make ON CONFLICT DO NOTHING and ON CONFLICT DO UPDATE consistent
List pgsql-hackers
On Wed, Jan 25, 2023 at 11:01 AM Aleksander Alekseev
<aleksander@timescale.com> wrote:
> Just to make sure we are on the same page. The patch doesn't break the
> current DO NOTHING behavior but rather makes DO UPDATE work the same
> way DO NOTHING does.

It also makes DO UPDATE not work the same way as either UPDATE itself
(which will silently skip a second or subsequent update of the same
row by the same UPDATE statement in RC mode), or MERGE (which has
similar cardinality violations).

DO NOTHING doesn't lock any conflicting row, and so won't have to
dirty pages that have matching rows. It was always understood to be
more susceptible to certain issues (when in READ COMMITTED mode) as a
result. There are some halfway reasonable arguments against this sort
of behavior, but I believe that we made the right trade-off.

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Christoph Moench-Tegeder
Date:
Subject: Re: pg_upgrade from PG-14.5 to PG-15.1 failing due to non-existing function
Next
From: Mahmoud Sakr
Date:
Subject: Re: Implement missing join selectivity estimation for range types