FRiCKLE / ngx_postgres

upstream module that allows nginx to communicate directly with PostgreSQL database.
http://labs.frickle.com/nginx_ngx_postgres/
BSD 2-Clause "Simplified" License
545 stars 122 forks source link

Serializing Postgres array into JSON array #43

Closed nepsilon closed 8 years ago

nepsilon commented 9 years ago

Any plan to have Postgres' array column type serialized into a JSON array instead of a string?

agentzh commented 9 years ago

@nepsilon I think it's better to be a feature in one of those lua-resty-* libraries for PostgreSQL based on ngx_lua's cosockets, which can be much more flexible. Like this:

https://github.com/leafo/pgmoon

(though I have my own plans on a lua-resty-postgresql library).

buddy-ekb commented 9 years ago

There is another approach with fresh postgres servers (9.2+): query returns a JSON-value while a client does something like JSON.parse() on the result. Though this somehow tangles the query text it indeed simplifies further data processing.

nepsilon commented 9 years ago

@buddy-ekb Thanks for the tip. I'll look into it :+1:

nepsilon commented 8 years ago

That fixed it. Thanks. I'm closing the issue.