Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lr5FS-0002iu-0Z for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Jun 2021 20:56:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lr5FQ-0004jA-Kx for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Jun 2021 20:56:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lr5FQ-0004j2-D7 for pgsql-hackers@lists.postgresql.org; Wed, 09 Jun 2021 20:56:24 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lr5FO-0007I7-PA for pgsql-hackers@lists.postgresql.org; Wed, 09 Jun 2021 20:56:23 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 5A5531D58; Wed, 9 Jun 2021 16:56:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 09 Jun 2021 16:56:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=hv8fFFWzfCAm+CjLenQK7llKeoq+yC12BE8seEszYi8=; b=GBwsbCMA 51nNp+xeYoFrPZU3XkDIgpiey8Q6E6dfpdqiQx53GUKql3uQ3tTVYY4n1Wcpk2lE VX5NSQWTlgt5kK20dWmfBUB9xrre/YvS/tOymS6t5xiJo678l+b7EEYr7CLVvPVi ny2XyzYglPNiPsx9qezWzt8gi+hMYqTUhE3k/TQ1CbTY3VrEHQTtmBmQf+hFCh3w mTvyrnY/CrSZ2RCXlA2D4KNvrnGlzQB94IMJ2t0JauLmuqR+/sQymRbVlagesFyc kd0ioKBixhkqkUDy5lrutKXYG/DgF4XwyI5xMdUJ6J/17XNErHb7bHu3aHZHja1/ whogkge9Z8rnVQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeduuddgudehvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjgesthekredttddtudenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepgeegveevffevjeffudethfdvtdeggefhhffguefhfeej iefgvefhfeelvedtudetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Jun 2021 16:56:19 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 5854E2A0A4D; Wed, 9 Jun 2021 16:56:17 -0400 (-04) Date: Wed, 9 Jun 2021 16:56:17 -0400 From: Alvaro Herrera To: "Jonathan S. Katz" Cc: Tom Lane , PostgreSQL Hackers Subject: Re: unnesting multirange data types Message-ID: <202106092056.qitkvnvmpadu@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <429daa9c-0fa0-1b0b-fc2f-54fe2e8db80f@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Jun-09, Jonathan S. Katz wrote: > I did a couple more tests around this. > > As suspected, in PL/pgSQL, there is no way to unpack or iterate over a > multirange type. Uh. This is disappointing; the need for some way to unnest or unpack a multirange was mentioned multiple times in the range_agg thread. I had assumed that there was some way to cast the multirange to a range array, or somehow convert it, but apparently that doesn't work. If the supporting pieces are mostly there, then I opine we should add something. -- Álvaro Herrera 39°49'30"S 73°17'W "Hay dos momentos en la vida de un hombre en los que no debería especular: cuando puede permitírselo y cuando no puede" (Mark Twain)