Create an array from the two columns, the aggregate the array:
select id, array_agg(array[x,y])
from the_table
group by id;
Note that the default text representation of arrays uses curly braces ( {..}) not square brackets ([..])
Create an array from the two columns, the aggregate the array:
select id, array_agg(array[x,y])
from the_table
group by id;
Note that the default text representation of arrays uses curly braces ( {..}) not square brackets ([..])