Skip site navigation (1) Skip section navigation (2)

About PostgreSQL's limit on arithmetic operations

From: Devrim GUNDUZ <devrim(at)gunduz(dot)org>
To: PostgreSQL Mailing Lists-General <pgsql-general(at)postgresql(dot)org>
Subject: About PostgreSQL's limit on arithmetic operations
Date: 2004-09-29 07:41:43
Message-ID: Pine.LNX.4.61.0409291030420.21620@emo.org.tr (view raw or flat)
Thread:
Lists: pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi,

We were performing some tests on PostgreSQL and found that it fails on the 
following query:

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.

We tested the same query on some other database servers:

Oracle 9 ias r2 : 9,22337203685478E18
Oracle 9i WinXP, 32 bit : 9223372036854775808
Oracle 9.2.0.3 on  Redhat 9 : 9223372036854775808
Oracle 9.2.0.3 on Redhat Advanced Server 2.1 : 9223372036854775808
MS-SQL Server 2000 : 9223372036854775808
MySQL on Sun Solaris 6 : -9223372036854775808
MySQL on Red Hat Enterprise Linux 3.0 : -9223372036854775808

It seems that MySQL and PostgreSQL fails on this query. Is this a bug, or 
a lack of something?

... or is there a limit?

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)

iD8DBQFBWmc4tl86P3SPfQ4RAliCAJ9JJA3111mxrcBnnWptI8cTQzdpoQCgsBQV
HMKeNGowkd35BhMwW6kWwbs=
=BWS3
-----END PGP SIGNATURE-----

Responses

pgsql-general by date

Next:From: Shridhar DaithankarDate: 2004-09-29 08:29:17
Subject: Re: About PostgreSQL's limit on arithmetic operations
Previous:From: Michael MalleteDate: 2004-09-29 07:10:57
Subject: error: unicode characters greater than or equal to 0x10000

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group