Helper function for pg array literals.
Added type parameter. Tests.