Re: [QUESTIONS] Error on PostgreSQL agregate SUM() function?? - Mailing list pgsql-hackers

From Thomas G. Lockhart
Subject Re: [QUESTIONS] Error on PostgreSQL agregate SUM() function??
Date
Msg-id 34E329E8.7DD683E9@alumni.caltech.edu
Whole thread Raw
In response to Re: [QUESTIONS] Error on PostgreSQL agregate SUM() function??  (sferac@bo.nettuno.it)
Responses Re: [QUESTIONS] Error on PostgreSQL agregate SUM() function??  (sferac@bo.nettuno.it)
List pgsql-hackers
> > > PostgreSQL SUMs population column given -1523690296 (overflow)
> > > While SOLID and MySQL gives 2771277000.
> > > Is it correct to have an overflow with SUM() function ?
> > Do you know what technique Solid and/or MySQL use to allow an integer summation to
> > exceed the range of a signed 32-bit integer? Do they do summations using floating
> > point? Let us know...
>
> To have overflows isn't a merit but a lack.
> MySQL and SOLID don't use overflow even on SUM(float):

Yes, I understood your point. However, we need a description of an alternative
implementation to evaluate; can you describe the implementation of Solid or MySQL for
the sum() operator wrt integers?? Does it use a float8 as the accumulator?

> ... PostgreSQL isn't coherent;
> it gives an overflow message on sum(float)
> and nothing when overflow on sum(int) or sum(smallint).

Yes, on some or all platforms Postgres allows silent overflows on integer types. I'm
not certain about the behavior for all platforms. Is the "float" type on MySQL and
Solid 4 bytes or eight? If eight, how do they "allow" overflows??

                                                           - Tom


pgsql-hackers by date:

Previous
From: "Kenji T. Hollis"
Date:
Subject: Re: [HACKERS] PostGreSQL v6.2.1 for Linux Alpha
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] PostGreSQL v6.2.1 for Linux Alpha