Integer parsing bug? - Mailing list pgsql-bugs

From Steve Atkins
Subject Integer parsing bug?
Date
Msg-id 20040227221714.GA21675@gp.word-to-the-wise.com
Whole thread Raw
Responses Re: Integer parsing bug?  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-bugs
Section 8.1 of the manual gives the range of an integer
as -2147483648 to +2147483647.


template1=# select '-2147483648'::int;
    int4
-------------
 -2147483648
(1 row)

template1=# select -2147483648::int;
ERROR:  integer out of range

Oops.

template1=# select version();
                           version
-------------------------------------------------------------
 PostgreSQL 7.4.1 on i686-pc-linux-gnu, compiled by GCC 2.96
(1 row)

Completely vanilla build - no options other than --prefix to
configure. Clean installation, this is immediately after an initdb.

I see the same bug on Solaris, built with Forte C in 64 bit mode.

Cheers,
  Steve

pgsql-bugs by date:

Previous
From: Philipp Matthias Hahn
Date:
Subject: round(50.5) = 50
Next
From: "Gary WAN"
Date:
Subject: About Create Assertion