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 1lsPFQ-0007Pe-5d for pgsql-hackers@arkaria.postgresql.org; Sun, 13 Jun 2021 12:29:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lsPFP-00071H-3p for pgsql-hackers@arkaria.postgresql.org; Sun, 13 Jun 2021 12:29:51 +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 1lsPFO-0006yJ-S1 for pgsql-hackers@lists.postgresql.org; Sun, 13 Jun 2021 12:29:50 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lsPFI-00061t-Sl for pgsql-hackers@lists.postgresql.org; Sun, 13 Jun 2021 12:29:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:References:Cc:To:From:Subject:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=K3cf36SoMhU73ojqPL0OnbxnkdLffb+NuZY8JLkX6SA=; b=bmhfR3hEsSmgafWi/tACikZ+Rw fYLpfwR01Ek2vY420E8jYvahggHJ49jaj/RQUrkMU8QzgAVP+U3aDI5AaqftIGtPyCLW+aWfG9F6Z g1HkdDOPZ/QJ9htdxTa8wTuZfGxeL6kKuAAVGccWCpeRq3ZKsUiwiFaXP6rLf9IFinQm4uOz9Wxll odPtd3gYbrYaBVAXKRjGbb2E7yoJtG7Dorlm6tSOnsux+mjpwWDw5moeP0zUYGvILhSfAClKLLnur +a7NyqrlVZ1JreU7C8gwIGs3MzUSnFOgvj3takTgLE45vLe2/F5TJDhZRuxiI9LYp8tebmkfkIOi9 ACvsoSWQ==; Received: from mobile-166-171-187-249.mycingular.net ([166.171.187.249] helo=Ph33rHippo.local) by meldrar.postgresql.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lsPFF-0006sm-DC; Sun, 13 Jun 2021 12:29:43 +0000 Subject: Re: unnesting multirange data types From: "Jonathan S. Katz" To: Alexander Korotkov Cc: Justin Pryzby , Alvaro Herrera , Tom Lane , PostgreSQL Hackers References: <202106092056.qitkvnvmpadu@alvherre.pgsql> <95432464-1b63-bc84-6f84-e9e9d79f9687@postgresql.org> <20210610220416.GJ16435@telsasoft.com> <20210611233017.GO16435@telsasoft.com> <3648e50c-eb0d-4d16-7194-1a1c62893726@postgresql.org> <43916655-ccb0-f132-a292-67927a7a3ab3@postgresql.org> Message-ID: <793a75cc-7d03-24ce-8f39-2f56555a0764@postgresql.org> Date: Sun, 13 Jun 2021 08:29:38 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <43916655-ccb0-f132-a292-67927a7a3ab3@postgresql.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mnrlGZvhjoMMEf322eGmp4ynEsmTPkG2x" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mnrlGZvhjoMMEf322eGmp4ynEsmTPkG2x Content-Type: multipart/mixed; boundary="fHNtoPVYrQIpGSNMCXyy3k9KpIufgh7aW"; protected-headers="v1" From: "Jonathan S. Katz" To: Alexander Korotkov Cc: Justin Pryzby , Alvaro Herrera , Tom Lane , PostgreSQL Hackers Message-ID: <793a75cc-7d03-24ce-8f39-2f56555a0764@postgresql.org> Subject: Re: unnesting multirange data types References: <202106092056.qitkvnvmpadu@alvherre.pgsql> <95432464-1b63-bc84-6f84-e9e9d79f9687@postgresql.org> <20210610220416.GJ16435@telsasoft.com> <20210611233017.GO16435@telsasoft.com> <3648e50c-eb0d-4d16-7194-1a1c62893726@postgresql.org> <43916655-ccb0-f132-a292-67927a7a3ab3@postgresql.org> In-Reply-To: <43916655-ccb0-f132-a292-67927a7a3ab3@postgresql.org> --fHNtoPVYrQIpGSNMCXyy3k9KpIufgh7aW Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/13/21 8:26 AM, Jonathan S. Katz wrote: > One question: if I were to make a custom multirange type (e.g. let's sa= y > I use "inet" to make "inetrange" and then a "inetmultirange") will this= > method still work? It seems so, but I wanted clarify. I went ahead and answered this myself: "yes": CREATE TYPE inetrange AS RANGE (SUBTYPE =3D inet); SELECT unnest(inetmultirange(inetrange('192.168.1.1', '192.168.1.5'), inetrange('192.168.1.7', '192.168.1.10'))); unnest ---------------------------- [192.168.1.1,192.168.1.5) [192.168.1.7,192.168.1.10) (2 rows) Awesome stuff. Jonathan --fHNtoPVYrQIpGSNMCXyy3k9KpIufgh7aW-- --mnrlGZvhjoMMEf322eGmp4ynEsmTPkG2x Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEE+oS2la8r95ogZD/x8QSccp8cZScFAmDF+jIFAwAAAAAACgkQ8QSccp8cZSfl /g/7BxMC+ASwBHW3upHIDMtWyz9kAvUpJLz36S+/OcskDNA90lummP1xTP04gNFHJWts4UBT6IFi 5iZGIPWLdSYP7BwMy1mAEyGK0Sm35XLB/rjx3IwGVi2MTzQBCeuTGB+kjGYUmkWj7bZmy79Px6y0 +U5cPmy6MvDc9nRw2hYAUzKCf6B8a8jhcE2V2SqE1rzVOHiLX0zd3VPE9g+DBhESdNVW71w0AVO8 Y6QO8sv6Rec1bWBj5xuy6Jp56Ni5SMJG1udqXs0dJyRmfymTpcAk2Dsj2KnjmTtDOwmM//yyBcD2 KNReb3rH+hk06HzcpgAljhmrYyr2hFh1Ay+MwlGw5goVP0+7VLDUcKeSeqLkS6B77RpGulRXOyJA xaCSRwCrmfsxCBfnho3mu9pWNxPY4EPJQlvLbF4/Ft2mReOoYXfbpCMquzWJmYbtpNQ8pmMdQfsN gcrOZjIyHlcZuHwATsB+dgrvhWeJyBRIC4orIHFh7aa9O4Tx/fOWzdOHtWyhJ058xFUUpiRyEHha LAxOfrbTCsHtrOF9IvzxuAsXYxSKKir4iYyf5atHg8zWnQ+PM9ErlXdVYYrLkdL8TUAA9cmPP5YE kC6MoTK9vwgldkdfUIdtsUKdhdwjQ7wFbw/EuB7ZLlsDKXdax+QBKEgSJd2lax218O3ZeXsAahnt BtE= =Fqd7 -----END PGP SIGNATURE----- --mnrlGZvhjoMMEf322eGmp4ynEsmTPkG2x--