Re: ffunc called multiple for same value

Поиск
Список
Период
Сортировка
От Mike Mascari
Тема Re: ffunc called multiple for same value
Дата
Msg-id 41017769.3090204@mascari.com
обсуждение исходный текст
Ответ на Re: ffunc called multiple for same value  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:

> So I'm rather inclined to define this behavior as "not a bug".  The fact
> that you're complaining seems to indicate that your ffunc scribbles on
> its input, which is bad programming practice in any case.  Ordinarily
> I would not think that an ffunc should have any problem with being
> executed repeatedly on the same final transvalue.  (If you really want
> to do things that way, maybe your code should take responsibility for
> keeping a flag to execute just once, rather than pushing the cost onto
> everybody.)
> 
> Comments anyone?

As someone who makes use of C language aggregate functions, I agree 
with your analysis, so long as the fact that an ffunc may be invoked 
more than once is well documented, (i.e. an SGML <note> section 
might be nice.)

Mike Mascari




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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ffunc called multiple for same value
Следующее
От: Ian Burrell
Дата:
Сообщение: Re: ffunc called multiple for same value