From: Tom Lane <tgl@sss.pgh.pa.us>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Dustin Sanza <dustin.sanza@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: PostgreSQL 17: protecting role attributes between verification and COMMIT
Date: Sun, 25 Oct 2026 09:07:16 -0400
Message-ID: <322424.1792933636@sss.pgh.pa.us> (raw)
In-Reply-To: <3fbab45e94b26f0a10a0ec25b00a4adc991e1f4f.camel@cybertec.at>
References: <CAL1nGzS2JFLqUhjNh5VaRHCZ9Y92oBvUUiaX8k3i6josY-CS7Q@mail.gmail.com>
<3fbab45e94b26f0a10a0ec25b00a4adc991e1f4f.camel@cybertec.at>
Laurenz Albe <laurenz.albe@cybertec.at> writes:
> On Fri, 2026-10-23 at 14:20 -0700, Dustin Sanza wrote:
>> The narrow question: under the privileges above, is there supported
>> SQL that prevents or safely serializes concurrent ALTER ROLE attribute
>> changes until COMMIT without first rewriting those attributes and
>> potentially concealing unexpected drift?
> I don't think so.
> You could use a SECURITY DEFINER function owned by a superuser that
> LOCK pg_catalog.pg_authid IN SHARE MODE;
> to prevent concurrent role modifications.
Or SELECT ... FROM pg_catalog.pg_authid FOR UPDATE, which would have
the advantage of locking only relevant rows not the whole catalog.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, laurenz.albe@cybertec.at, dustin.sanza@gmail.com
Subject: Re: PostgreSQL 17: protecting role attributes between verification and COMMIT
In-Reply-To: <322424.1792933636@sss.pgh.pa.us>
References: <CAL1nGzS2JFLqUhjNh5VaRHCZ9Y92oBvUUiaX8k3i6josY-CS7Q@mail.gmail.com> <3fbab45e94b26f0a10a0ec25b00a4adc991e1f4f.camel@cybertec.at> <322424.1792933636@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox