Support for unnest(multirange) and cast multirange as an array of ranges
authorAlexander Korotkov <akorotkov@postgresql.org>
Tue, 15 Jun 2021 12:59:20 +0000 (15:59 +0300)
committerAlexander Korotkov <akorotkov@postgresql.org>
Tue, 15 Jun 2021 12:59:20 +0000 (15:59 +0300)
commit29854ee8d1ca4a46adb7e84deb17e6fb18e531cc
treea6ea193f0b2e8beb4b51d0cafcaf3d2a81f9602f
parent4daa140a2f50e9a160bc180c3997ee13c7aabf9e
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
doc/src/sgml/func.sgml
doc/src/sgml/rangetypes.sgml
src/backend/commands/typecmds.c
src/backend/utils/adt/multirangetypes.c
src/include/catalog/catversion.h
src/include/catalog/pg_cast.dat
src/include/catalog/pg_proc.dat
src/test/regress/expected/multirangetypes.out
src/test/regress/expected/opr_sanity.out
src/test/regress/sql/multirangetypes.sql
src/test/regress/sql/opr_sanity.sql