Don't allow composite type to be member of itself via multirange
Heikki Linnakangas <heikki.linnakangas@iki.fi>
Author:
Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: 2026-04-23T18:28:11Z
Releases:
19 (unreleased)
Don't allow composite type to be member of itself via multirange CheckAttributeType() checks that a composite type is not made a member of itself with ALTER TABLE ADD COLUMN or ALTER TYPE ADD ATTRIBUTE, even indirectly via a domain, array, another composite type or a range type. But it missed checking for multiranges. That was a simple oversight when multiranges were added. Reviewed-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://www.postgresql.org/message-id/93ce56cd-02a6-4db1-8224-c8999372facc@iki.fi Backpatch-through: 14
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/heap.c | modified | +10 −0 |
| src/test/regress/expected/multirangetypes.out | modified | +3 −0 |
| src/test/regress/sql/multirangetypes.sql | modified | +3 −0 |
Discussion
- CheckAttributeType() forgot to recurse into multiranges 4 messages · 2026-04-22 → 2026-04-23