how can I select into an array?

From: "Andy Kriger" <akriger(at)greaterthanone(dot)com>
To: "Pgsql-General" <pgsql-general(at)postgresql(dot)org>
Subject: how can I select into an array?
Date: 2004-02-06 15:37:08
Message-ID: 200402061555.i16Ft6G29410@server1.greaterthanone.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I would like to select strings from a table and return them as an array
For example,
select new_array(name) from my_tbl
would return
String[] { name1, name2, name3, etc }

Is this possible with built-in SQL/psql functions?
If not, how hard would it be to write a function that does this? (given that
I have coding experience but none writing pgsql functions)

Andy Kriger | Software Mechanic | Greater Than One, Inc.
28 West 27th Street | 7th Floor | New York, NY 10001
P: 212.252.7197 | F: 212.252.7364 | E: akriger(at)greaterthanone(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2004-02-06 15:42:15 Re: newbie question... how do I get table structure?
Previous Message Peter Alberer 2004-02-06 15:27:17 Re: Run 2 versions of Postgresql on one machine?