my query is :
select d.id,array_to_string(array_accum('name',',')) as name from (select * from temp1 a left join temp3 c on a.id=c.leftid left join temp2 b on b.id=c.rightid) d group by d.id;
But it gives me following error :
ERROR: function array_accum(unknown, unknown) does not exist