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)
Ответы: Re: [PATCHES] array_accum aggregate  (Martijn van Oosterhout)
Список: pgsql-hackers

Скрыть дерево обсуждения

Re: [PATCHES] array_accum aggregate  (Tom Lane, )
 Re: [PATCHES] array_accum aggregate  (Stephen Frost, )
  Re: [PATCHES] array_accum aggregate  (Tom Lane, )
   Re: [PATCHES] array_accum aggregate  (Tom Lane, )
    Re: [PATCHES] array_accum aggregate  (Martijn van Oosterhout, )
     Re: [PATCHES] array_accum aggregate  (Tom Lane, )
      Re: [PATCHES] array_accum aggregate  (Stephen Frost, )
       Re: [PATCHES] array_accum aggregate  (Tom Lane, )
        Re: [PATCHES] array_accum aggregate  (Stephen Frost, )
         Re: [PATCHES] array_accum aggregate  (Tom Lane, )
  Re: [PATCHES] array_accum aggregate  (Bruce Momjian, )

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 по дате сообщения:

От: Christopher Browne
Дата:
Сообщение: Re: [PERFORM] Hints proposal
От: "Ivan Zolotukhin"
Дата:
Сообщение: Re: Fwd: pg_dump VS alter database ... set search_path ...