Re: WIP json generation enhancements : strange IS NULL behaviour - Mailing list pgsql-hackers

From Tom Lane
Subject Re: WIP json generation enhancements : strange IS NULL behaviour
Date
Msg-id 16993.1353962541@sss.pgh.pa.us
Whole thread Raw
In response to Re: WIP json generation enhancements : strange IS NULL behaviour  (Hannu Krosing <hannu@2ndQuadrant.com>)
List 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 by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: WIP json generation enhancements : strange IS NULL behaviour
Next
From: Robert Haas
Date:
Subject: Re: Removing PD_ALL_VISIBLE