Hannu Krosing <ha...@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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to