public inbox for pgsql-general@postgresql.org
help / color / mirror / Atom feedFrom: Matt Magoffin <postgresql.org@msqr.us>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Confirmation on concurrent SELECT FOR UPDATE with ON CONFLICT DO NOTHING
Date: Tue, 5 May 2026 07:53:39 +1200
Message-ID: <0B23DB17-EB6B-4B56-9A61-D7A35A039DA2@msqr.us> (raw)
In-Reply-To: <83819e975523be4d320141ff1363dfb40c82289b.camel@cybertec.at>
References: <087DA595-FB65-49F4-89E9-AE9F5CBF6E4C@msqr.us>
<ba59699c-a5af-4a27-affd-6836dc813047@aklaver.com>
<8BCF50C4-D36B-4453-9B09-AA717AE6F563@msqr.us>
<bd0599f050972d15202ba30ab872972a050ba8e0.camel@cybertec.at>
<93ADF4E5-CF49-4347-8A79-33655A8E0299@msqr.us>
<83819e975523be4d320141ff1363dfb40c82289b.camel@cybertec.at>
> 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 is found. 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 that would include.
Kind regards,
Matt
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-general@postgresql.org
Cc: postgresql.org@msqr.us, laurenz.albe@cybertec.at, adrian.klaver@aklaver.com, pgsql-general@lists.postgresql.org
Subject: Re: Confirmation on concurrent SELECT FOR UPDATE with ON CONFLICT DO NOTHING
In-Reply-To: <0B23DB17-EB6B-4B56-9A61-D7A35A039DA2@msqr.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox