Re: Transition functions for SUM(::int2), SUM(::int4, SUM(::int8])

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Caleb Welton <cwelton(at)greenplum(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Transition functions for SUM(::int2), SUM(::int4, SUM(::int8])
Date: 2008-01-29 21:06:59
Message-ID: 25794.1201640819@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Caleb Welton <cwelton(at)greenplum(dot)com> writes:
> Forgive me if I'm being dense, but could you explain why

> int4_sum(bigint,int) must not be strict, but
> int4_avg_accum(bytea, int) can be strict?

The former is used with a NULL initial value, the latter isn't.
Read the fine print in the CREATE AGGREGATE man page about behavior
with strict transition functions.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Cristian Gafton 2008-01-29 21:08:25 Re: Large pgstat.stat file causes I/O storm
Previous Message Tom Lane 2008-01-29 21:00:49 Re: [PATCHES] Proposed patch: synchronized_scanning GUCvariable