Re: Newbiee Pls help.....

From: Jens Wilke <jens(at)wilke(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Newbiee Pls help.....
Date: 2011-07-29 19:20:49
Message-ID: 201107292120.50126.jens@wilke.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Freitag, 29. Juli 2011, woow wrote:

> I have following function expectation is I want to return the
> items in array
> SELECT INTO rolelist role_id FROM roles WHERE role_type =
> $1; RETURN rolelist;

Hi,

you've to use array_agg:
SELECT INTO rolelist array_agg(role_id) FROM roles WHERE
role_type = $1;

Regards, Jens

In response to

Browse pgsql-general by date

  From Date Subject
Next Message bricklen 2011-07-29 22:45:59 Finding referecing and referenced tables, adaptation from David Fetter's solution
Previous Message Brent Wood 2011-07-29 18:23:18 Factors Influencing Participant Satisfaction with Free/Libre and Open Source Software Projects