-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
array_to_json return type is string. It should be an array #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
in fact, new Array(row.thumb) doesn't work ... i am struggling how to get my postgres array column into a javascript Array, with or without using array_to_json |
I've found this stll open issue : #10 Funny part : a Postgres Array of Integer doesn't need this parseArray function. |
I just spent some time realizing this as well. What I found out: Set up a table:
Program:
Result:
As you can imagine, the result for |
Well, I've been through this problem too. It appears that it's a problem interpreting varchar Arrays. A simple change in your select to SELECT 'hello' AS a, would (temporarily) solve the problem. |
Interesting - I'll take a look. As an aside in your initial example you use |
I think this is fixed - a char array parser was added to https://github.com/brianc/node-pg-types/blob/master/lib/textParsers.js |
array_to_json return type is string. It should be an array.
So now I have to do :
query.on('row', function(row) {
row.thumb = new Array(row.thumb);
[...]
The text was updated successfully, but these errors were encountered: