Postgresql Create Array Js Functions