Integer parsing bug?

From: Steve Atkins <steve(at)blighty(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Integer parsing bug?
Date: 2004-02-27 22:17:14
Message-ID: 20040227221714.GA21675@gp.word-to-the-wise.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Gary WAN 2004-02-28 01:17:19 About Create Assertion
Previous Message Peter Eisentraut 2004-02-27 22:10:43 Re: BUG #1087: psql dumps core on CTRL+ALT+\