[HACKERS] json_agg produces nonstandard json - Mailing list pgsql-hackers

From Jordan Deitch
Subject [HACKERS] json_agg produces nonstandard json
Date
Msg-id CAK1UM_YDJOXEyZu4c3whMV1AekOL-KekXyhY_3WVw7odsyxPcg@mail.gmail.com
Whole thread Raw
Responses Re: [HACKERS] json_agg produces nonstandard json  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hello!

I apologize in advanced if this has been previously discussed;

A json(b)_agg() will produce the following result when no results are passed in:

"[null]"

per:

select jsonb_agg((select 1 where false));

I believe, generally speaking, '[]' would be the more appropriate output. 

Would postgres welcome a patch to handle the empty case of json(b)_agg?

Thanks!

---
Jordan Deitch

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [HACKERS] CTE inlining
Next
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] CTE inlining