Re: Converting each item in array to a query result row

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adam Ruth <adamruth(at)mac(dot)com>
Cc: Postgres User <postgres(dot)developer(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Converting each item in array to a query result row
Date: 2009-05-29 14:44:57
Message-ID: 17210.1243608297@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adam Ruth <adamruth(at)mac(dot)com> writes:
> I needed to do this just the other day, here's what I did:

> create or replace function explode(_a anyarray) returns setof
> anyelement as $$

You'd be well advised to call this unnest(), because that's what the
equivalent built-in function in 8.4 is called ;-)

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2009-05-29 14:50:37 Re: I can't drop a user if I don't drop his grants beforehand??????????????????
Previous Message Osvaldo Kussama 2009-05-29 14:08:08 Re: Converting each item in array to a query result row