| From: | Noah Misch <noah(at)leadboat(dot)com> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Lock affected rowtype and dependent types on ALTER ATTRIBUTE |
| Date: | 2026-11-09 14:22:04 |
| Message-ID: | E1xQQG4-000000003p0-1Vfu@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
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(at)anarazel(dot)de>
Security: CVE-2026-6460
Backpatch-through: 14
Branch
------
REL_17_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/83ec4accdcec1dccb3b7ecab7567af8938834145
Author: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)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(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Noah Misch | 2026-11-09 14:22:05 | pgsql: Introduce attribute versioning to prevent unsafe deforming |
| Previous Message | Noah Misch | 2026-11-09 14:22:03 | pgsql: Check table ownership when DROP OWNED BY changes policies. |