Re: [PATCHES] array_accum aggregate

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCHES] array_accum aggregate
Дата
Msg-id 20443.1160693932@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCHES] array_accum aggregate  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [PATCHES] array_accum aggregate
Список pgsql-hackers
I wrote:
> aggregate_state would have no other uses in the system, and its input
> and output functions would raise an error, so type safety is assured
> --- there would be no way to call either the sfunc or ffunc "manually",
> except by passing a NULL value, which should be safe because that's what
> they'd expect as the aggregate initial condition.

Um, no, I take that back, unless you want to invent a separate
pseudotype for each such aggregate.  Otherwise you can crash it with

    my_ffunc(your_sfunc(null, whatever))

because my_ffunc will be expecting a datastructure different from what
it gets.

Maybe having a check for AggState call context is enough of a defense for
that, but I'm not really satisfied.  Back to the drawing board ...

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Stamp 7.3.16.
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Stamp 7.3.16.