0

I have 3 array columns and i am trying to get the count for each of these arrays but node-postgres is only returning one of them which is the last array_length() passed in the SQL statement. I passed the same sql query using the postgres console and it returned all the results.

1
  • PostgreSQL and node_postgres versions? Exact query text and exact output text? Sample data? Unless someone here has psychic powers... Commented Feb 5, 2013 at 1:30

1 Answer 1

1

Ok figured it out, the array query needs to be wrapped in brackets

(array_length(friends,1),array_length(clients, 1),array_length(venues, 1)) 

and this will return for e.g (3,3,7), otherwise only the last query will return (7).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.