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

From Jordan Deitch
Subject Re: [HACKERS] json_agg produces nonstandard json
Date
Msg-id CAK1UM_b1PZGXPfEjjfQo8i_eLck56SHepPLQ0rHFPeKY9XaMwg@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] json_agg produces nonstandard json  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] json_agg produces nonstandard json
List pgsql-hackers
Thank you for responding! 

Good points. 

However, I don't see consistency between the results of these two statements:

select jsonb_agg((select 1 where false));
select sum((select 1 where false));

Therefore another option I would like to suggest is returning the same null value-types for the sum() and json_agg().

So the select jsonb_agg((select 1 where false)); would return null as opposed to [null]. In this case it would be compatible with coalesce()

---
Thanks
Jordan Deitch

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] WITH clause in CREATE STATISTICS
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] CTE inlining