Re: Newbiee Pls help..... - Mailing list pgsql-general

From Jens Wilke
Subject Re: Newbiee Pls help.....
Date
Msg-id 201107292120.50126.jens@wilke.org
Whole thread Raw
In response to Newbiee Pls help.....  (woow <ruwanb@gmail.com>)
List 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

pgsql-general by date:

Previous
From: Brent Wood
Date:
Subject: Factors Influencing Participant Satisfaction with Free/Libre and Open Source Software Projects
Next
From: bricklen
Date:
Subject: Finding referecing and referenced tables, adaptation from David Fetter's solution