From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Lock affected rowtype and dependent types on ALTER ATTRIBUTE
Date: Mon, 09 Nov 2026 14:21:55 +0000
Message-ID: <E1xQQFv-000000003Vr-196V@gemulon.postgresql.org> (raw)
Lock affected rowtype and dependent types on ALTER ATTRIBUTE
On ALTER TYPE ... ALTER ATTRIBUTE, acquire AccessExclusiveLock on the
rowtype, and all dependent types (arrays, domains, etc. over the
target type). This ensures that a concurrent backend doesn't add a
dependency to the type that we would miss in our dependency checks.
We were already holding the lock on the corresponding relation, and
that conflicted with many operations, but not all operations that use
a type also lock its relation.
Note that we don't lock types (or other objects except relations) when
using them in queries, so the AccessExclusiveLock doesn't prevent
concurrent queries from using the type.
Reviewed-by: Andres Freund <andres@anarazel.de>
Security: CVE-2026-6460
Backpatch-through: 14
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/37c733dd39abc1d143f5938ab773e655a5a553a4
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Modified Files
--------------
src/backend/commands/tablecmds.c | 9 +++++++++
src/test/isolation/expected/type-ddl-locking.out | 4 +++-
src/test/isolation/specs/type-ddl-locking.spec | 1 -
3 files changed, 12 insertions(+), 2 deletions(-)
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-committers@postgresql.org
Cc: noah@leadboat.com
Subject: Re: pgsql: Lock affected rowtype and dependent types on ALTER ATTRIBUTE
In-Reply-To: <E1xQQFv-000000003Vr-196V@gemulon.postgresql.org>
References: <E1xQQFv-000000003Vr-196V@gemulon.postgresql.org>
* 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