On Tue, 11 Apr 2006, Tom Lane wrote:
We could maybe change things so that the finalfunc isn't run unless the result value is actually demanded in the SELECT list or HAVING clause, but for 99.99% of applications checking that would be a waste of cycles, so I'm disinclined to do it.
I'm lacking experience here so I perfectly trust you that keeping the default case as it is. The question is, whether adding an option to change the default might make sense.
As Martijn said, really you want to fix the finalfunc so that it behaves sanely in corner cases. An aggregate that fails on zero rows needs work, period.
Fully ACK. As I hopefully made clear I just used it as a sign / proof, that something works differently than I would regard reasonable (before I understand the problem with the aggregate). Kind regards Andreas. -- http://fam-tille.de ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org