Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group