Re: About PostgreSQL's limit on arithmetic operations

Поиск
Список
Период
Сортировка
От Devrim GUNDUZ
Тема Re: About PostgreSQL's limit on arithmetic operations
Дата
Msg-id Pine.LNX.4.61.0409291142570.21620@emo.org.tr
обсуждение исходный текст
Ответ на Re: About PostgreSQL's limit on arithmetic operations  (Shridhar Daithankar <shridhar@frodo.hserus.net>)
Ответы Re: About PostgreSQL's limit on arithmetic operations  (Shridhar Daithankar <shridhar@frodo.hserus.net>)
Список 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 по дате отправления:

Предыдущее
От:
Дата:
Сообщение: Re: Syntax Issue in Trigger Function??
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: sql script confusion