作者
digoal
日期
2021-07-19
标签
PostgreSQL , multirange , unnest
背景
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=9e3c217bd98da803709872a8612577d88a39329a
```
Support for unnest(multirange)
author Alexander Korotkov akorotkov@postgresql.org
Sun, 18 Jul 2021 18:07:24 +0000 (21:07 +0300)
committer Alexander Korotkov akorotkov@postgresql.org
Sun, 18 Jul 2021 18:07:24 +0000 (21:07 +0300)
commit 9e3c217bd98da803709872a8612577d88a39329a
tree 3e9738500a42ca4a2d9d07d33a22699b455fb1c7 tree
parent ba620760c4c8ca90ff83ecf7e4d46f5ec4dabd7b commit | diff
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
```
```
+--
+-- test unnest(multirange) function
+--
+select unnest(int4multirange(int4range('5', '6'), int4range('1', '2')));
+ unnest
+--------
+ [1,2)
+ [5,6)
+(2 rows)
+
+select unnest(textmultirange(textrange('a', 'b'), textrange('d', 'e')));
+ unnest
+--------
+ [a,b)
+ [d,e)
+(2 rows)
+
+select unnest(multirange_of_text(textrange1('a','b'), textrange1('d','e')));
+ unnest
+--------
+ [a,b)
+ [d,e)
+(2 rows)
+
```
PostgreSQL 许愿链接
您的愿望将传达给PG kernel hacker、数据库厂商等, 帮助提高数据库产品质量和功能, 说不定下一个PG版本就有您提出的功能点. 针对非常好的提议,奖励限量版PG文化衫、纪念品、贴纸、PG热门书籍等,奖品丰富,快来许愿。开不开森.