The standard function to do this is spelled 'array_agg'