"Andy Kriger" <akriger(at)greaterthanone(dot)com> writes:
> I would like to select strings from a table and return them as an array
You can do that beginning in 7.4 with the ARRAY(sub-select) construct.
regression=# select f1 from text_tbl;
f1
-------------------
doh!
hi de ho neighbor
(2 rows)
regression=# select array(select f1 from text_tbl);
?column?
----------------------------
{doh!,"hi de ho neighbor"}
(1 row)
regression=#
In prior versions you could probably fake it with a loop in a plpgsql
function, but it'd be kinda awkward.
regards, tom lane