Postgres Function Select Into Array Methods Javascript