select id, array_agg(array[x,y])
from the_table
group by id;