Re: [HACKERS] json_agg produces nonstandard json

Поиск
Список
Период
Сортировка
Искать
От
Jordan Deitch
Тема
Re: [HACKERS] json_agg produces nonstandard json
Дата
в 21:50:35
Msg-id
CAK1UM_b1PZGXPfEjjfQo8i_eLck56SHepPLQ0rHFPeKY9XaMwg@mail.gmail.com
Ответ на
Список
Дерево обсуждения
[HACKERS] json_agg produces nonstandard json Jordan Deitch <jwdeitch@gmail.com>
Re: [HACKERS] json_agg produces nonstandard json Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] json_agg produces nonstandard json Jordan Deitch <jwdeitch@gmail.com>
Re: [HACKERS] json_agg produces nonstandard json Tom Lane <tgl@sss.pgh.pa.us>
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 по дате отправления
От: Alvaro Herrera
Дата:
FAQ