Re: onlyvalue aggregate (was: First Aggregate Funtion?)

Поиск
Список
Период
Сортировка
От Marko Tiikkaja
Тема Re: onlyvalue aggregate (was: First Aggregate Funtion?)
Дата
Msg-id 5637422B.4090203@joh.to
обсуждение исходный текст
Ответ на Re: onlyvalue aggregate (was: First Aggregate Funtion?)  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Ответы Re: onlyvalue aggregate (was: First Aggregate Funtion?)
Список pgsql-hackers
On 11/2/15 9:32 AM, Dean Rasheed wrote:
> On 28 October 2015 at 16:50, Marko Tiikkaja <marko@joh.to> wrote:
>> Here's a patch for the aggregate function outlined by Corey Huinker in
>> CADkLM=foA_oC_Ri23F9PbfLnfwXFbC3Lt8bBzRu3=CB77G9_qw@mail.gmail.com .
>
> +1. I've wanted something like this a few times. Of the names
> suggested so far, I think I prefer "single_value", and yes I think it
> should work with NULLs.

This was actually a last-minute design change I made before submitting 
the patch.  The two times I've previously written this aggregate both 
accepted NULLs and only enforced that there must not be more than one 
non-NULL value, but that's only because I was thinking about the "poor 
man's FILTER" case, which is obsolete since version 9.4.  The reason I 
changed in this version is that accepting NULLs can also hide bugs, and 
it's (usually) easy to filter them out with FILTER.

Did you have some specific use case in mind where accepting NULLs would 
be beneficial?


.m



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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: onlyvalue aggregate (was: First Aggregate Funtion?)
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: WIP: Access method extendability