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

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 (view raw or flat)
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

pgsql-general by date

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

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