[GENERAL] JSON_AGG produces extra square brakets

2014-11-30 Thread Davide S
I'm using JSON_AGG to create some arrays, but I get an invalid json (I'm using the latest postgres 9.4 in debian testing). Quick explanation: I've got some objects called Things that have Tags (many-to-many through the table ThingTag); Things also have a single ThingTemplate, which has ThingStates

Re: [GENERAL] JSON_AGG produces extra square brakets

2014-12-02 Thread Davide S
| [{"image_url":"img1.jpg","severity":10}, {"image_url":"img2.jpg","severity":20}]] (2 rows) Note the ']]' at the end of the second row (the third would have 3 brackets, and so on). Some info on my system (debian testing, u

Re: [GENERAL] JSON_AGG produces extra square brakets

2014-12-02 Thread Davide S
Thank you! Glad to have helped! On Tue, Dec 2, 2014 at 7:40 PM, Tom Lane wrote: > Davide S writes: > > This is a small testcase that reproduces the problem on my machine. > > Ah, I see it: json_agg_finalfn is violating the rule that an aggregate > final function can't sc