| From: | Noah Misch <noah(at)leadboat(dot)com> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Avoid visiting a type twice in find_composite_type_dependencies( |
| Date: | 2026-11-09 14:22:10 |
| Message-ID: | E1xQQGA-00000000422-0kZ7@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
Avoid visiting a type twice in find_composite_type_dependencies()
When recursing, keep track of visited types in a hash table. This is
currently just an insignificant performance optimization, but it will
come handy in the upcoming patches where we can use the hash table to
do expensive catalog scans only once. The upcoming patches will be
backpatched which is why this is backpatched too.
Add a test for the case that a type ultimately depends on the same
composite type via two different paths. That's the case where the
hash table lets us avoid some work. It isn't very likely to be
broken, but let's have coverage for it for the sake of completeness.
Security: CVE-2026-6460
Backpatch-through: 14
Branch
------
REL_15_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/4428c073af2fcbed9f17670a3e2a9549d809fe0e
Author: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
Modified Files
--------------
src/backend/commands/tablecmds.c | 53 +++++++++++++++++++++----
src/test/regress/expected/alter_column_type.out | 7 ++++
src/test/regress/sql/alter_column_type.sql | 8 ++++
3 files changed, 61 insertions(+), 7 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Noah Misch | 2026-11-09 14:22:11 | pgsql: Reject pseudo-type output parameters in SQL functions. |
| Previous Message | Noah Misch | 2026-11-09 14:22:09 | pgsql: Fix use-after-free issues due to drop of portals being set up |