Skip site navigation (1) Skip section navigation (2)

generate_subscripts

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: generate_subscripts
Date: 2008-03-24 19:01:15
Message-ID: 162867790803241201o5d43dbd3mea6413a721300a91@mail.gmail.com (view raw or flat)
Thread:
Lists: 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: generate_subscripts.diff
Description: text/x-patch (8.6 KB)

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2008-03-24 19:59:01
Subject: Re: script binaries renaming
Previous:From: Bruce MomjianDate: 2008-03-24 18:24:21
Subject: Re: [PATCHES] Eliminate more detoast copies for packed varlenas

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group