Hacker News new | ask | show | jobs
by rosser 4326 days ago
It depends on the version. More recent releases (that is, >= 9.2) do have native JSON support, but it's still young — though steadily improving.
1 comments

Yup, I've done a bit with 9.2, and it accepts JSON just fine (although not with automatic string conversion) but it's a short road to wishing the data were in standard tables and columns.
Use dollar-quoting for automatic string conversion:

insert into my_table values ($$ json_goes_here $$);

Works for all stringy things.

Cool, thanks. Last time around I used a pg-driver-specific datatype to hold the parameter on its way through sql2o, and felt rather guilty about doing so.