Re: different unnest function [SOLVED] - Mailing list pgsql-general

From Ondrej Ivanič
Subject Re: different unnest function [SOLVED]
Date
Msg-id CAM6mieLRvpjgFrHGLWLnxvqr8TpLqyotxf26n+ge5iCo8GnVgQ@mail.gmail.com
Whole thread Raw
List pgsql-general
Hi,

> to get the output OP wants, you need to expand and rewrap:
> create or replace function unnest2(anyarray) returns setof anyarray AS
> $BODY$
> select array(select unnest($1[i:i])) from
> generate_series(array_lower($1,1), array_upper($1,1)) i;
> $BODY$
> language 'sql';

Yup, this is what I need. Thanks


--
Ondrej Ivanic
(ondrej.ivanic@gmail.com)

pgsql-general by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Alternative JDBC driver
Next
From: Toby Corkindale
Date:
Subject: Re: PostgreSQL benchmarked on XFS vs ZFS vs btrfs vs ext4