Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wFoOJ-005Zpg-0K for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Apr 2026 07:22:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wFoOH-000I1N-1L for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Apr 2026 07:22:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wFoOH-000I1E-0O for pgsql-hackers@lists.postgresql.org; Thu, 23 Apr 2026 07:22:25 +0000 Received: from fout-a2-smtp.messagingengine.com ([103.168.172.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wFoOF-00000002boW-0LI8 for pgsql-hackers@postgresql.org; Thu, 23 Apr 2026 07:22:24 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id C52F1EC0489; Thu, 23 Apr 2026 03:22:20 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Thu, 23 Apr 2026 03:22:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1776928940; x=1777015340; bh=TCy1GzDbBe z87ixYLSQ7Fm93VWkjNQdmyAbyPT8TYns=; b=OR3vNnbZQQakxAoh1YC461YoE0 y5gKhY8ir0IH+4GpVbWBfcxJhn1KmT8a3DsZQjvqNo4O7Mm4Xhp9hYl8BB78y8rZ MCc53+2F+rcOKJ9q7yZjGziUMuUi/UQw0OssQXshXDHvJYTVIP/sy9BpLLnER6k0 6GRD1nkEzWOV4qxxcq/0Oj/138zdIeGaphIYDuf5U5BT2QuCOgV4H4xaedtvGchC z7lqN/8fTuG25mo8c9ai4yeL0MhONs8bdE63vBK2xY7XD7O2/LKeUU0XjUquN0Xu KPitnmVw7qszKBqUC4Vk5SoKF+ZJvadbzY1BP2ZD9HIVM4jvrty5sRQb9RBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1776928940; x=1777015340; bh=TCy1GzDbBez87ixYLSQ7Fm93VWkjNQdmyAb yPT8TYns=; b=WwkjophfreaUemPyG7+8/RhlUb6vrJu/aIh+iRcgHu90XKt1RdW GgTObRfdNZOBeWKW0w5u+7o3xyLkXXQc0bm57AzP1l1ntNwoVrYfj2FlZBfRG2jT uS7Oh6awGsL0uPZR96A5ZxqpfCQYZy4mwxoYNobiCY6PUE8iXSsWdYMONOPTpCb0 a++IIFinbRcYvWMU3fy5t+PkS3cHne3fgBQe46QtrG5+EfAtMqaDmrzbvkaboH+n 2mbZKaLNtOT2foiwkVAd6s4aYplWNCj2YyY+IT3EjNRxJsK8gQmVPJaHqvegEjx5 LM4Ga8YnZrDQtcx9WDGg7SVd2awA0tShCxw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdeiieehgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeggeff hfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhn sggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehhlhhinh hnrghkrgesihhkihdrfhhipdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrshesphho shhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 23 Apr 2026 03:22:19 -0400 (EDT) Date: Thu, 23 Apr 2026 16:22:15 +0900 From: Michael Paquier To: Heikki Linnakangas Cc: "pgsql-hackers@postgresql.org" Subject: Re: CheckAttributeType() forgot to recurse into multiranges Message-ID: References: <93ce56cd-02a6-4db1-8224-c8999372facc@iki.fi> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xSlUz3lx03CgQRqu" Content-Disposition: inline In-Reply-To: <93ce56cd-02a6-4db1-8224-c8999372facc@iki.fi> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --xSlUz3lx03CgQRqu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Apr 22, 2026 at 11:56:12PM +0300, Heikki Linnakangas wrote: > That looks like a straightforward oversight in CheckAttributeType(). When > multiranges were introduced, it didn't get the memo. Nice catch. --- this must be rejected to avoid self-inclusion issues: +-- these must be rejected to avoid self-inclusion issues: alter type two_ints add attribute c two_ints_range; ERROR: composite type two_ints cannot be made a member of itself +alter type two_ints add attribute c two_ints_multirange; +ERROR: composite type two_ints cannot be made a member of itself If you want to create a parallel with multirangetypes.sql, this choking case may be better if placed there rather than rangetypes.sql, as it is a multi case. Not a big deal, still. > While working on the fix, I noticed that in case of dropped columns, > CheckAttributeType() is called with InvalidOid. It tolerates that, but it > seems accidental and it performs a bunch of futile syscache lookups with > InvalidOid, so it would be better to not do that. The second patch fixes > that. This one seems harmless as far as I can see, but we should be careful to bypass any attisdropped while scanning a set of attributes, so a backpatch is in order, indeed. LGTM. -- Michael --xSlUz3lx03CgQRqu Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmnpyKcACgkQnvQgOdby QH0Qhg//ShEtbc6zwcdlj8boYXxreAmtGM6uzrNtP3vlQwxPVpwA3vCTshV/S3Pe nCczIeSOwIq5Oed0xTIMf21sE+Ulk2FcCobi5OnfzUjGtau8MiKYUtwPrkCR/p0+ 6fgkJnbOaemztgD6wEnifc40BNGRUo5R0BBp23Z0cAPBdqrmFxTiQrOlxpn1B9MH oCRdsM6+mjV4iNXgDST8VScdYcZZ/sf0H9SKFkVyg7IIjnflNv6t9hRKVMpLK8mn kA1ZwdsyUsB9vEWgjcy8GfHlZ7cVlEiFC4DYbgOmcbM0N+Vi2sJg9xLAttPAkpRn +PqEWzSqngfGDqaokntNjL5Vkyv57XRRv0QDZSmb24vxbyF1RjnMxnl2BsPtclyK LIG4r31Qs6dfS6Gy7mXXO6BmWAyeGFvKhDGX9FqvYXk2WrBJ57tf8PXbHZfYsJ6u mKw3Eny2tyB1Wghng75c1HTQQYl2nomWkGtVg4l9a0rInoGxdHhgNaH9RQdAeesC 1SW7GkPoUKnR32nDGQEZXLgOcAAfD9iXAArBRO1eUZW5mC0c1Z268Ow2kIpYTtap 67hAMQWJdWlyPDH9QGOh7rMqAFKN00pvMU5qAV2v6kxGfJxAQYZr8KhW1dyGp+Ou 6XclJRphTtwkmBcJx5wO+KaJzyUmtT8R/VIAMXXXB1vYeQ7pYpQ= =Rqw0 -----END PGP SIGNATURE----- --xSlUz3lx03CgQRqu--