Re: ffunc called multiple for same value - Mailing list pgsql-hackers

From Mike Mascari
Subject Re: ffunc called multiple for same value
Date
Msg-id 41017769.3090204@mascari.com
Whole thread Raw
In response to Re: ffunc called multiple for same value  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: ffunc called multiple for same value
Next
From: Ian Burrell
Date:
Subject: Re: ffunc called multiple for same value