Re: multiple paramters in aggregate function

Поиск
Список
Период
Сортировка
От Karsten Hilbert
Тема Re: multiple paramters in aggregate function
Дата
Msg-id 20090820125222.GD5532@merkur.hilbert.loc
обсуждение исходный текст
Ответ на Re: multiple paramters in aggregate function  (Sim Zacks <sim@compulab.co.il>)
Список pgsql-general
On Thu, Aug 20, 2009 at 03:30:00PM +0300, Sim Zacks wrote:

>         In other words, I have a conversion table of all different units. If
>         there is no conversion between 2 units (such as volume and area) then
>         the sum returns null.
>
>
>     Shouldn't that return NULL IOW unknown ?
>
> I am not familiar with returning unknown. I know that according to the spec an
> aggregate

Oh, OK, I forgot about the aggregate part.

> should only return null if all of its values of the aggregate are
> null. If there is a way to return unknown in a non-NULL way, then that would be
> preferred.

I don't know of any. However, it seems patently wrong to let
an integer sum()-something return 0 when some of its inputs
are NULL. After all, the sum could truly have been 0. This
should either throw an error, return NULL, or let me choose
to ignore NULL input and return the sum of non-NULL input.

But I have a feeling I am tip-toeing into a Holy War situation.

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

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

Предыдущее
От: Thom Brown
Дата:
Сообщение: Re: Generating random unique alphanumeric IDs
Следующее
От: Jasen Betts
Дата:
Сообщение: Re: Postgre RAISE NOTICE and PHP