Re: [PATCH] Negative Transition Aggregate Functions (WIP)

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: [PATCH] Negative Transition Aggregate Functions (WIP)
Дата
Msg-id CAApHDvqieH2=BywtP-J6HHbcruZh1Jo-n0_U_hGC-M=EZ7wrWQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Negative Transition Aggregate Functions (WIP)  (Florian Pflug <fgp@phlo.org>)
Ответы Re: [PATCH] Negative Transition Aggregate Functions (WIP)  (Florian Pflug <fgp@phlo.org>)
Список pgsql-hackers
On Fri, Jan 17, 2014 at 3:05 PM, Florian Pflug <fgp@phlo.org> wrote:

I've now shuffled things around so that we can use inverse transition functions
even if only some aggregates provide them, and to allow inverse transition
functions to force a restart by returning NULL. The rules regarding NULL handling
are now the following


Maybe this is me thinking out loud, but I'm just thinking about the numeric case again.
Since the patch can now handle inverse transition functions returning NULL when they fail to perform inverse transitions, I'm wondering if we could add an "expectedscale" to NumericAggState, set it to -1 initially, when we get the first value set the expectedscale to the dscale of that numeric, then if we get anything but that value we'll set the expectedscale back to -1 again, if we are asked to perform an inverse transition with a expectedscale as -1 we'll return null, otherwise we can perform the inverse transition...

Thoughts?

Regards

David Rowley 

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

Предыдущее
От: Gregory Smith
Дата:
Сообщение: Re: [v9.4] row level security
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] surprising to_timestamp behavior