Postgres Select Ids Into Array In Javascript Functions And Parameters