postgres array_agg to string code example
Example 1: postgresql string_agg
STRING_AGG ( expression, separator [order_by_clause] )
Example 2: postgresql array to rows
unnest( your_array )
STRING_AGG ( expression, separator [order_by_clause] )
unnest( your_array )