Re: About PostgreSQL's limit on arithmetic operations - Mailing list pgsql-general

From Devrim GUNDUZ
Subject Re: About PostgreSQL's limit on arithmetic operations
Date
Msg-id Pine.LNX.4.61.0409291142570.21620@emo.org.tr
Whole thread Raw
In response to Re: About PostgreSQL's limit on arithmetic operations  (Shridhar Daithankar <shridhar@frodo.hserus.net>)
Responses Re: About PostgreSQL's limit on arithmetic operations  (Shridhar Daithankar <shridhar@frodo.hserus.net>)
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi,

On Wed, 29 Sep 2004, Shridhar Daithankar wrote:

>>
>> SELECT 512*18014398509481984 AS result;
>>
>> and the result is:
>>
>>          result
>> ----------------------
>>   -9223372036854775808
>>
>> It should be 9223372036854775808... This is PostgreSQL 7.4.5 on Fedora
>> Core 2.
>
>
> shridhar@ps0499:~$ psql template1

<snip>

> template1=# SELECT 512*18014398509481984::numeric(20) AS result;
>       result
> ---------------------
> 9223372036854775808
> (1 row)

Ok, I got the same result in 7.4.5... But... Why do we have to cast it
into numeric? The results from other databases shows that they can perform
it without casting...

Anyway, thanks for the tip.

Regards,

- --
Devrim GUNDUZ
devrim~gunduz.org                devrim.gunduz~linux.org.tr
             http://www.tdmsoft.com
             http://www.gunduz.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFBWniTtl86P3SPfQ4RAt9/AJ0dG8bXaDVgqAvtgIDiEAX7MwU4YACfeR+l
c4nhYwft3NvJWhOdHJ90Lm8=
=4uVc
-----END PGP SIGNATURE-----

pgsql-general by date:

Previous
From:
Date:
Subject: Re: Syntax Issue in Trigger Function??
Next
From: Richard Huxton
Date:
Subject: Re: sql script confusion