Обсуждение: BUG #2775: Error select

Поиск
Список
Период
Сортировка

BUG #2775: Error select

От
"Mas Kus"
Дата:
The following bug has been logged online:

Bug reference:      2775
Logged by:          Mas Kus
Email address:      kusuma_ok@telkom.net
PostgreSQL version: 7.4.1-2
Operating system:   Mandrake 10.0
Description:        Error select
Details:

Hello...
I'm using Mandrake 10.0 full version as my OS. And use it for my web server.
I've installed the PostgreSQL to my server. The connection to the database
is good. I try to select by :

=>select 2147*1000000;
  ?column?
--------------
 2147000000

But, when I tried select :

=>select 2148*1000000;
  ?column?
------------------
 -214623000

Or When I try to multiply with the number than result more than 2147000000,
the result is minus or wrong.

Can you help me why ?

Thank you.

Re: BUG #2775: Error select

От
Tom Lane
Дата:
"Mas Kus" <kusuma_ok@telkom.net> writes:
> But, when I tried select :

> =>select 2148*1000000;
>   ?column?
> ------------------
>  -214623000

PG releases before 8.0 don't check for overflow in integer multiplication.

            regards, tom lane