Integer range?

From: Scott Ribe <scott_ribe(at)killerbytes(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Integer range?
Date: 2009-10-09 16:46:39
Message-ID: C6F4C50F.C62E8%scott_ribe@killerbytes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The range of a twos-complement 32-bit integer is -2147483648 through
2147483647. Yet in Postgres:

# select -2147483647::int4;
?column?
-------------
-2147483647
(1 row)

# select -2147483648::int4;
ERROR: integer out of range

Is this a bug? Or something required by the SQL standard?

(8.3.7, OS X 10.5.8, 32-bit build)

--
Scott Ribe
scott_ribe(at)killerbytes(dot)com
http://www.killerbytes.com/
(303) 722-0567 voice

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Naoko Reeves 2009-10-09 16:47:29 How to identify nested level of trigger
Previous Message Whit Armstrong 2009-10-09 16:41:21 Re: array question