Re: [QUESTIONS] Error on PostgreSQL agregate SUM() function??

Поиск
Список
Период
Сортировка
От Thomas G. Lockhart
Тема Re: [QUESTIONS] Error on PostgreSQL agregate SUM() function??
Дата
Msg-id 34E1B598.D800CC81@alumni.caltech.edu
обсуждение исходный текст
Ответы Re: [HACKERS] Re: [QUESTIONS] Error on PostgreSQL agregate SUM() function??
Re: [QUESTIONS] Error on PostgreSQL agregate SUM() function??
Список pgsql-hackers
> PostgreSQL SUMs population column given -1523690296 (overflow)
> While SOLID and MySQL gives 2771277000.
>
> Who are right PostgreSQL or SOLID and MySQL ?

Duh.

> 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...

                                                  - Tom

> name      | population
> ----------+-----------
> RUSSIA    |  281170000
> INDIA     |  766140000
> CHINA     | 1072220000
> JAPAN     |  129947000
> CANADA    |   25610000
> U.S.A.    |  242080000
> MEXICO    |   81160000
> BRAZIL    |  141450000
> ARGENTINA |   31500000
>
> postgres=> select sum(populazione) from nations;
>         sum
> -----------
> -1523690296
>
> mysql> select sum( populazione) from nations;
> 1 row in set (0.05 sec)
> +-------------------+
> | sum( population)  |
> +-------------------+
> |        2771277000 |
> +-------------------+
>
> SOLID SQL Editor (teletype) v.02.20.0007
> (C) Copyright Solid Information Technology Ltd 1993-1997
> Execute SQL statements terminated by a semicolon.
> Exit by giving command: exit;
> Connected to default server.
>
> select sum(population) from nations;
> SUM(POPULATION)
> ----------------
>     2771277000
> 1 rows fetched.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: jwieck@debis.com (Jan Wieck)
Дата:
Сообщение: Re: [HACKERS] rule system, perl and other good stuff
Следующее
От: darcy@druid.net (D'Arcy J.M. Cain)
Дата:
Сообщение: Re: [HACKERS] PL/Tcl