Re: [HACKERS] 6.5.0 - Overflow bug in AVG( )

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Gene Sokolov <hook(at)aktrad(dot)ru>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] 6.5.0 - Overflow bug in AVG( )
Date: 1999-06-16 14:03:38
Message-ID: 3767AEBA.E7C006B9@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Float8 accumulator seems to be a good solution if AVG is limited to
> int/float types. I wonder if it could produce system dependency in AVG due
> to rounding errors. Some broader solution should be considered though if you
> want AVG to work on numeric/decimal as well.

The implementation can be specified for each datatype individually, so
that's not a problem. afaik the way numeric/decimal work it would be
fine to use those types as their own accumulators. It's mostly the
int2/int4/int8 types which are the problem, since they silently
overflow (on most machines?).

- Thomas

--
Thomas Lockhart lockhart(at)alumni(dot)caltech(dot)edu
South Pasadena, California

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1999-06-16 14:06:58 Re: [HACKERS] 6.5.0 - Overflow bug in AVG( )
Previous Message Bruce Momjian 1999-06-16 14:00:47 Re: [HACKERS] Savepoints...