Re: [HACKERS] partial aggregation with internal state type

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] partial aggregation with internal state type
Дата
Msg-id 31823.1497024396@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [HACKERS] partial aggregation with internal state type  (Jeff Janes <jeff.janes@gmail.com>)
Ответы Re: [HACKERS] partial aggregation with internal state type  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-hackers
Jeff Janes <jeff.janes@gmail.com> writes:
> The docs for creating aggregates for 9.6 and beyond say:
> "For aggregate functions whose state_data_type is internal, the combinefunc
> must not be strict. In this case the combinefunc must ensure that null
> states are handled correctly and that the state being returned is properly
> stored in the aggregate memory context."

> Since combinefunc with an internal type is only useful when serialfunc and
> deserialfunc are also defined, why can't the built-in machinery just do the
> right thing when faced with a strict combinefunc?

The issue is how to initialize the state value to begin with.

I suppose you're imagining that we could fill pg_aggregate.agginitval
with something that the serialfunc could read.  But that would place
serious constraints on the serialization format, like that it be
machine-independent and valid as text.
        regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] strcmp() tie-breaker for identical ICU-collated strings
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] strcmp() tie-breaker for identical ICU-collated strings