Re: json_agg produces nonstandard json

From: Jordan Deitch <jwdeitch(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: json_agg produces nonstandard json
Date: 2017-05-04 18:50:35
Message-ID: CAK1UM_b1PZGXPfEjjfQo8i_eLck56SHepPLQ0rHFPeKY9XaMwg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-05-04 18:52:34 Re: CTE inlining
Previous Message Alvaro Herrera 2017-05-04 18:48:33 Re: WITH clause in CREATE STATISTICS