generate_subscripts - Mailing list pgsql-patches

From Pavel Stehule
Subject generate_subscripts
Date
Msg-id 162867790803241201o5d43dbd3mea6413a721300a91@mail.gmail.com
Whole thread Raw
Responses Re: generate_subscripts
List pgsql-patches
Hello

This patch contains generate_subscripts functions, that generate
series of array's subscripts of some dimension:

postgres=#
create or replace function unnest2(anyarray)
returns setof anyelement as $$
select $1[i][j]
   from generate_subscripts($1,1) g1(i),
        generate_subscripts($1,2) g2(j);
$$ language sql immutable;

postgres=# select * from unnest2(array[[1,2],[3,4]]);
 unnest2
---------
       1
       2
       3
       4
(4 rows)

Proposal: http://archives.postgresql.org/pgsql-hackers/2007-10/msg00874.php

Regards
Pavel Stehule

Attachment

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: script binaries renaming
Next
From: Tom Lane
Date:
Subject: Re: script binaries renaming