1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Support for unnest(multirange)

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), which is quite trivial.
unnest(multirange) is defined as a polymorphic procedure.

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, Tom Lane
Reviewed-by: Alvaro Herrera
This commit is contained in:
Alexander Korotkov
2021-07-18 21:07:24 +03:00
parent ba620760c4
commit 9e3c217bd9
5 changed files with 131 additions and 0 deletions

View File

@ -19181,6 +19181,29 @@ SELECT NULLIF(value, '(none)') ...
<returnvalue>{[1,2)}</returnvalue>
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm>
<primary>unnest</primary>
<secondary>for multirange</secondary>
</indexterm>
<function>unnest</function> ( <type>anymultirange</type> )
<returnvalue>setof anyrange</returnvalue>
</para>
<para>
Expands a multirange into a set of ranges.
The ranges are read out in storage order (ascending).
</para>
<para>
<literal>unnest('{[1,2), [3,4)}'::int4multirange)</literal>
<returnvalue></returnvalue>
<programlisting>
[1,2)
[3,4)
</programlisting>
</para></entry>
</row>
</tbody>
</tgroup>
</table>