agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Don't allow composite type to be member of itself via multirange
Date: Thu, 23 Apr 2026 18:48:42 +0000
Message-ID: <E1wFz6P-002NKl-29@gemulon.postgresql.org> (raw)

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

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c7a1d5fc651371d6dac6e82f35e43b2adc81e72f

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(+)



view thread (6+ messages)

Message-ID: <E1wFz6P-002NKl-29@gemulon.postgresql.org>
Permalink:  ../E1wFz6P-002NKl-29@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wFz6P-002NKl-29@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Don't allow composite type to be member of itself via multirange
  In-Reply-To: <E1wFz6P-002NKl-29@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox