The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
19 views

Dynamic chart data from MySQL

I'm building a chart with JS, where i'm doing a query with PHP and pass it to chart in JSON format. The problem is the whole table exported in json file gets up to 10mb, and it takes too much time ...
0
votes
1answer
77 views

How do I return JSON structured as the transpose of json_agg() in PostgreSQL?

I'm trying to convert an arbitrary subquery to JSON in PostgreSQL. json_agg() seems like the obvious tool for the job. For example: select json_agg(a) from ( select count(lead_source), ...
1
vote
1answer
167 views

PostgreSQL JSON field performance with large documents

How well is the Postgre JSON type optimized for large JSON documents? I am especially concerned about partial retrieval (e.g. the cost of getting the last N items of a JSON array or looking up one ...
2
votes
1answer
293 views

How can I update a json element in postgresql json datatype

I can't figure how can I update an element in a postgresql 9.3 datatype. My exemple the db CREATE TABLE "user" ( id uuid NOT NULL, password character varying(255), profiles json, gender ...
2
votes
1answer
208 views

How to create an index on an integer json property in postgres

I can't figure out for the life of me how to create an index on a property of my json column which is an integer. I tried it this way (and also dozens of others) CREATE INDEX user_reputation_idx ON ...
2
votes
2answers
1k views

How to turn json array into postgres array?

I have a field user that holds a json document that roughly looks like that: { name: 'foo', tags: ['foo', 'bar'] } What I would like to do is to turn that tags array into a concatenated ...
6
votes
3answers
2k views

What can I do with the new json field?

PostgreSQL 9.2 introduced the json field type. Why and when should I use it? What benefits does it have over a text field? I thought there were new query options available, however I haven't seen ...