PostgreSQL has an aggregate function called array_agg()
that allows us to generate an array from the result set of a query.
The function accepts an argument which is used to generate the array. This argument is typically the column that we want to use in order to populate the array.
Continue reading