Check for Consts in constraint definitions

Similar to previous commit, we also need to look more closely at a
dependency from a constraint to a composite type.  The constraint's
DEFAULT might contain a Const or other expression that would need to
be rewritten, if the composite type was ALTERed.

For all reporters and public discussions, see previous commits.

Co-authored-by: Nathan Bossart <[email protected]>
Reviewed-by: Amit Langote <[email protected]>
Reviewed-by: Andres Freund <[email protected]>
Security: CVE-2026-6460
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7e1aeaad34fbede9c23cc9c6dd2f92d4864af514
Author: Heikki Linnakangas <[email protected]>

Modified Files
--------------
src/backend/commands/tablecmds.c                | 32 ++++++++++++++++++++++++-
src/test/regress/expected/alter_column_type.out | 23 ++++--------------
src/test/regress/expected/alter_table.out       |  9 ++++---
src/test/regress/sql/alter_column_type.sql      | 10 ++------
src/test/regress/sql/alter_table.sql            |  7 +++---
5 files changed, 44 insertions(+), 37 deletions(-)

Reply via email to