Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 561586325DA for ; Tue, 22 Jun 2010 05:37:01 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 77705-09 for ; Tue, 22 Jun 2010 08:36:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wy0-f174.google.com (mail-wy0-f174.google.com [74.125.82.174]) by mail.postgresql.org (Postfix) with ESMTP id 69FF16323AE for ; Tue, 22 Jun 2010 05:36:53 -0300 (ADT) Received: by wyb33 with SMTP id 33so2921407wyb.19 for ; Tue, 22 Jun 2010 01:36:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=soZZIJaDp8jYkgdTLvVq0vlDRulJpSikW4vU8/bxuWg=; b=WNFCKV9asg2aCCSl5xoYN1retZElsd0/8Ci6pkX9FsC+weFf4I2d0NTiIQ0UNslKID W8Cy15E2nTDOCuajxmc9OfZWTX3vvs7q2TlbAjvsokO2D2ejBll20qmcC8VMe/Jae2nG MO2twwobD1qevAeZqDlyEXdBNOyyGRrQq1CzQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=p73Ex1kb5S7XSDowG3Asbcft2r6Gh5spmmAQKHwOZD+0juV3OFo81qJHth7v6Ct5E5 026Or2z5b4aZybl0RVR5MglU5KQCrAjSt1TZDX+plnJz9Ib08XA1QrxQ1cG6Ct0lKpCz t6uT1kqe9cJk/7sOfbtWh2GUasY20+5tfR8s0= Received: by 10.216.154.69 with SMTP id g47mr4285657wek.82.1277195811145; Tue, 22 Jun 2010 01:36:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.231.221 with HTTP; Tue, 22 Jun 2010 01:36:30 -0700 (PDT) In-Reply-To: <4C207403.3080103@gmail.com> References: <4C207403.3080103@gmail.com> From: Thom Brown Date: Tue, 22 Jun 2010 09:36:30 +0100 Message-ID: Subject: Re: INTEGER range ("-2147483648" is not accepted.) To: Satoshi Nagayasu Cc: pgsql-docs@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201006/44 X-Sequence-Number: 5612 2010/6/22 Satoshi Nagayasu : > Hi all, > > I've found a bit strange thing on the INTEGER range in the official manua= l. > > http://www.postgresql.org/docs/8.4/interactive/datatype-numeric.html > > According to the official manual, the INTEGER range is "-2147483648 to +2= 147483647". > However, my example in below shows that "-2147483648" is not accepted. > > Is this correct? Any suggestions? > > Regards, > > --------------------------------------------------------------------- > template1=3D# SELECT version(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0version > -------------------------------------------------------------------------= ----------------------------------- > =A0PostgreSQL 8.4.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.2= 20071124 (Red Hat 4.1.2-42), 32-bit > (1 row) > > template1=3D# SELECT -2147483647::integer; > =A0?column? > ------------- > =A0-2147483647 > (1 row) > > template1=3D# SELECT -2147483648::integer; > ERROR: =A0integer out of range > template1=3D# SELECT +2147483648::integer; > ERROR: =A0integer out of range > template1=3D# SELECT +2147483647::integer; > =A0?column? > ------------ > =A02147483647 > (1 row) > > template1=3D# > --------------------------------------------------------------------- > Hmm... yes, that's not what I'd expect either: postgres=3D# SELECT -32768::smallint; ERROR: smallint out of range postgres=3D# SELECT -9223372036854775808::bigint; ERROR: bigint out of range I think those min values are all out by 1. Thom