pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Check for missing dependencies on types
2+ messages / 1 participants
[nested] [flat]

* pgsql: Check for missing dependencies on types
@ 2026-11-09 14:21 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Noah Misch @ 2026-11-09 14:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check for missing dependencies on types

If an expression that's stored in a catalog references a rowtype in a
way that would break ALTERing its attribute, we record a dependency on
the type, and find_composite_type_dependencies() prevents ALTERing it.
However, we have failed to record the dependency in some cases, namely
if the expression itself doesn't depend on the type in an incompatible
way, but produces a *result* of the given datatype which is stored.
That problem arises from index expressions, PARTITION BY expressions,
and from expression statistics.

To fix, scan the pg_index, pg_partitioned_table and pg_statistic_ext
catalogs for those cases as a separate sub-step of
find_composite_type_dependencies().  In the future, after we have
added the missing dependency creation and backfilled any existing
missing dependencies, we can remove this code.  That means, in a new
major version.

For all reporters and public discussions, see previous commits.

Co-authored-by: Nathan Bossart <nathan@postgresql.org>
Reviewed-by: Amit Langote <amitlangote09@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Security: CVE-2026-6460
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ac460a144ac2e602241e39f2ea2e16e307af6f54
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>

Modified Files
--------------
src/backend/commands/tablecmds.c                | 138 ++++++++++++++++++++++++
src/test/regress/expected/alter_column_type.out |  72 +++----------
src/test/regress/sql/alter_column_type.sql      |  35 +-----
3 files changed, 152 insertions(+), 93 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Check for missing dependencies on types
@ 2026-11-09 14:21 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Noah Misch @ 2026-11-09 14:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Check for missing dependencies on types

If an expression that's stored in a catalog references a rowtype in a
way that would break ALTERing its attribute, we record a dependency on
the type, and find_composite_type_dependencies() prevents ALTERing it.
However, we have failed to record the dependency in some cases, namely
if the expression itself doesn't depend on the type in an incompatible
way, but produces a *result* of the given datatype which is stored.
That problem arises from index expressions, PARTITION BY expressions,
and from expression statistics.

To fix, scan the pg_index, pg_partitioned_table and pg_statistic_ext
catalogs for those cases as a separate sub-step of
find_composite_type_dependencies().  In the future, after we have
added the missing dependency creation and backfilled any existing
missing dependencies, we can remove this code.  That means, in a new
major version.

For all reporters and public discussions, see previous commits.

Co-authored-by: Nathan Bossart <nathan@postgresql.org>
Reviewed-by: Amit Langote <amitlangote09@gmail.com>
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/39e620324c02264d14fdc1260b9aa752a9253e43
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>

Modified Files
--------------
src/backend/commands/tablecmds.c                | 138 ++++++++++++++++++++++++
src/test/regress/expected/alter_column_type.out |  72 +++----------
src/test/regress/sql/alter_column_type.sql      |  35 +-----
3 files changed, 152 insertions(+), 93 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-11-09 14:21 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 14:21 pgsql: Check for missing dependencies on types Noah Misch <noah@leadboat.com>
2026-11-09 14:21 pgsql: Check for missing dependencies on types Noah Misch <noah@leadboat.com>

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