Re: Confirmation on concurrent SELECT FOR UPDATE with ON CONFLICT DO NOTHING - Mailing list pgsql-general

From Matt Magoffin
Subject Re: Confirmation on concurrent SELECT FOR UPDATE with ON CONFLICT DO NOTHING
Date
Msg-id 0B23DB17-EB6B-4B56-9A61-D7A35A039DA2@msqr.us
Whole thread
In response to Re: Confirmation on concurrent SELECT FOR UPDATE with ON CONFLICT DO NOTHING  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-general

> On 1 May 2026, at 7:35 AM, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
>
> Also, the behavior difference only occurs with ON CONFLICT DO NOTHING.
> If you use ON CONFLICT ... DO UPDATE ..., the update will block.
> That makes the behavior difference somewhat less bad in my eyes.

Yes, I had noticed that as well. In my case my goal is to both block and “do nothing” if after blocking a matching row
isfound. If this behaviour isn’t expected, I thought I could change to 

ON CONFLICT DO UPDATE SET id = EXCLUDED.id

to essentially “do nothing” but I thought I would incur an actual update and I wanted to avoid the churn I presumed
thatwould include. 

Kind regards,
Matt



pgsql-general by date:

Previous
From: "Daniel Verite"
Date:
Subject: Re: Choosing default collation/ctype
Next
From: Laurenz Albe
Date:
Subject: Re: Choosing default collation/ctype