Postgresql Array Agg Where Clause With Joins