Re: WIP json generation enhancements : strange IS NULL behaviour

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WIP json generation enhancements : strange IS NULL behaviour
Date: 2012-11-26 20:42:21
Message-ID: 16993.1353962541@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hannu Krosing <hannu(at)2ndQuadrant(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-11-26 21:03:37 Re: Removing PD_ALL_VISIBLE
Previous Message Jeff Davis 2012-11-26 20:29:37 Re: Removing PD_ALL_VISIBLE