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 <[email protected]>
Discussion: 
https://www.postgresql.org/message-id/[email protected]
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/54343f6f9046caa31c71a72479fd567322d72591

Modified Files
--------------
src/backend/catalog/heap.c                    | 10 ++++++++++
src/test/regress/expected/multirangetypes.out |  3 +++
src/test/regress/sql/multirangetypes.sql      |  3 +++
3 files changed, 16 insertions(+)

Reply via email to