pgsql: Check relation dependencies more carefully

From: Noah Misch <noah(at)leadboat(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Check relation dependencies more carefully
Date: 2026-11-09 14:21:50
Message-ID: E1xQQFq-000000003L0-1wiG@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Check relation dependencies more carefully

Similar to previous commits, if a relation depends on a composite
type, we need to inspect it more carefully. We already checked tables
using the composite type in columns, but the dependency might also
exist because a partitioned table's PARTITION BY expression uses the
type, or an expression in an expression or partial index.

For all reporters and public discussions, see previous commits.

Co-authored-by: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Reviewed-by: Amit Langote <amitlangote09(at)gmail(dot)com>
Reviewed-by: Andres Freund <andres(at)anarazel(dot)de>
Security: CVE-2026-6460
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6e578eeb6d973f0ef0bb020221b236d62df1bf6a
Author: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>

Modified Files
--------------
src/backend/commands/tablecmds.c | 200 +++++++++++++++++++-----
src/test/regress/expected/alter_column_type.out | 36 ++---
src/test/regress/expected/generated_stored.out | 8 +
src/test/regress/expected/generated_virtual.out | 8 +
src/test/regress/sql/alter_column_type.sql | 22 ++-
src/test/regress/sql/generated_stored.sql | 7 +
src/test/regress/sql/generated_virtual.sql | 7 +
7 files changed, 216 insertions(+), 72 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2026-11-09 14:21:51 pgsql: Close portals at end of trigger functions with transition tables
Previous Message Noah Misch 2026-11-09 14:21:49 pgsql: Reject more unsafe names in extension script substitutions.