Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Clarify node-pg's strategy for the JSON data type in Postgres #239
Could you please mention what you think node-pg should be doing to handle the JSON data type that appeared in Postgres 9.2?
I've asked for more info here previously:
It'd be ideal if node-pg could parse or stringify the value of the json column going out or coming into postgres. If you need a hand with it let us know (although I also said that about node-sql and we've been super busy). In the interim we need to form a strategy for handling json data using node-pg.
Postgres @ 9.1 (travis's default version)
Postgres @ 9.2
Everything in the query text gets passed directly to the backend PostgreSQL server without any manipulation what so ever by node or node-postgres apart from
Think the issue I'm having is with prepared statements and hstore under pg v1.1.0:
.... raises the following entry in my Postgres.app log....
... hinting that $1 is not being expanded?
Prepared statements with hstore parameters do work OK inside PLSQL :
Somewhere along the way the JSON is not being accepted as a parameter by postgres? (probably something I'm doing wrong, but could someone confirm the above code and schema work from them?)
Thanks for any ideas, and a great library
The issue is I am confusing hstore with JSON :) [slaps forehead]
Was hoping that Postgres would provide a converter, but no luck. Maybe 9.3 will have something.
In the mean time, wrote a little JS function:
Which might help someone in this way: