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

Implement the basic form of UNNEST, ie unnest(anyarray) returns setof

anyelement.  This lacks the WITH ORDINALITY option, as well as the multiple
input arrays option added in the most recent SQL specs.  But it's still a
pretty useful subset of the spec's functionality, and it is enough to
allow obsoleting contrib/intagg.
This commit is contained in:
Tom Lane
2008-11-14 00:51:47 +00:00
parent 5b9453bcd3
commit c889ebce0a
7 changed files with 193 additions and 6 deletions

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.459 2008/11/13 23:01:09 tgl Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.460 2008/11/14 00:51:46 tgl Exp $ -->
<chapter id="functions">
<title>Functions and Operators</title>
@ -9482,6 +9482,17 @@ SELECT NULLIF(value, '(none)') ...
<entry><literal>string_to_array('xx~^~yy~^~zz', '~^~')</literal></entry>
<entry><literal>{xx,yy,zz}</literal></entry>
</row>
<row>
<entry>
<literal>
<function>unnest</function>(<type>anyarray</type>)
</literal>
</entry>
<entry><type>setof anyelement</type></entry>
<entry>expand an array to a set of rows</entry>
<entry><literal>unnest(ARRAY[1,2])</literal></entry>
<entry><literal>1</literal><para><literal>2</literal></para> (2 rows)</entry>
</row>
</tbody>
</tgroup>
</table>