Puoi usare string_agg
invece.
Impostazione dello schema PostgreSQL 9.1.6 :
create table T
(
Name varchar(10)
);
insert into T values('Kalle');
insert into T values('Pelle');
insert into T values('Urban');
Query 1 :
select string_agg(Name, ',') as Names
from T
| NAMES |
---------------------
| Kalle,Pelle,Urban |