Postgres Select Ids Into Array Methods Javascript Slice Vs Substring