Re: WIP json generation enhancements : strange IS NULL behaviour

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: WIP json generation enhancements : strange IS NULL behaviour
Дата
Msg-id 16993.1353962541@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: WIP json generation enhancements : strange IS NULL behaviour  (Hannu Krosing <hannu@2ndQuadrant.com>)
Список pgsql-hackers
Hannu Krosing <hannu@2ndQuadrant.com> writes:
> On 11/26/2012 09:05 PM, Tom Lane wrote:
>> The analogy to other aggregates is probably a better thing to argue
>> from.  On the other hand, I don't know anyone outside the SQL standards
>> committee who thinks it's actually a good idea that SUM() across no rows
>> returns null rather than zero.

> Might be done in order to be in sync with other aggregates - for
> example the "return NULL for no rows" behaviour makes perfect
> sense for MIN(), AVG(), etc.

Well, if they'd made COUNT() of no rows return null, then I'd agree that
they were pursuing consistency.  As it stands, it's neither consistent
nor very sensible.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: WIP json generation enhancements : strange IS NULL behaviour
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Removing PD_ALL_VISIBLE