select a list of column values directly into an array

From: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: select a list of column values directly into an array
Date: 2010-07-27 13:03:35
Message-ID: 482E80323A35A54498B8B70FF2B879800465B3CF95@azsmsx504.amr.corp.intel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is there a way to select a list of column values directly into an array?

create table foo (col1 text);
insert into foo (col1) values ('aaa'),('bbb'),('ccc'),('ddd'),('eee');

I'd like to load up an array with {aaa,bbb,ccc,ddd,eee}, prefferably with a single select statement.

Thanks in advance for any help!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2010-07-27 13:09:39 Re: select a list of column values directly into an array
Previous Message Ravi Katkar 2010-07-27 13:00:25 Re: [ODBC] resultset metadata libpq