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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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 Content-Type Size
generate_subscripts.diff text/x-patch 8.6 KB

Responses

Browse pgsql-patches by date

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