pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Support for unnest(multirange) and cast multirange as an array o
Date: Tue, 15 Jun 2021 12:59:41 +0000
Message-ID: <E1lt8fN-0001Jq-A5@gemulon.postgresql.org> (raw)

Support for unnest(multirange) and cast multirange as an array of ranges

It has been spotted that multiranges lack of ability to decompose them into
individual ranges.  Subscription and proper expanded object representation
require substantial work, and it's too late for v14.  This commit
provides the implementation of unnest(multirange) and cast multirange as
an array of ranges, which is quite trivial.

unnest(multirange) is defined as a polymorphic procedure.  The catalog
description of the cast underlying procedure is duplicated for each multirange
type because we don't have anyrangearray polymorphic type to use here.

Catversion is bumped.

Reported-by: Jonathan S. Katz
Discussion: https://postgr.es/m/flat/60258efe-bd7e-4886-82e1-196e0cac5433%40postgresql.org
Author: Alexander Korotkov
Reviewed-by: Justin Pryzby, Jonathan S. Katz, Zhihong Yu

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/29854ee8d1ca4a46adb7e84deb17e6fb18e531cc

Modified Files
--------------
doc/src/sgml/func.sgml                        |  23 ++++++
doc/src/sgml/rangetypes.sgml                  |  12 +++
src/backend/commands/typecmds.c               |  92 ++++++++++++++++++++--
src/backend/utils/adt/multirangetypes.c       | 106 ++++++++++++++++++++++++++
src/include/catalog/catversion.h              |   2 +-
src/include/catalog/pg_cast.dat               |  20 +++++
src/include/catalog/pg_proc.dat               |  23 ++++++
src/test/regress/expected/multirangetypes.out |  60 +++++++++++++++
src/test/regress/expected/opr_sanity.out      |   6 ++
src/test/regress/sql/multirangetypes.sql      |  13 ++++
src/test/regress/sql/opr_sanity.sql           |   6 ++
11 files changed, 354 insertions(+), 9 deletions(-)



Message-ID: <E1lt8fN-0001Jq-A5@gemulon.postgresql.org>
Permalink:  ../E1lt8fN-0001Jq-A5@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lt8fN-0001Jq-A5@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: akorotkov@postgresql.org
  Subject: Re: pgsql: Support for unnest(multirange) and cast multirange as an array o
  In-Reply-To: <E1lt8fN-0001Jq-A5@gemulon.postgresql.org>
  References: <E1lt8fN-0001Jq-A5@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox