Postgres Aggregate Into Arraylist Length Function