Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id BD5C6632340 for ; Tue, 22 Jun 2010 06:47:03 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 71861-01 for ; Tue, 22 Jun 2010 09:46:51 +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 42143632410 for ; Tue, 22 Jun 2010 06:46:52 -0300 (ADT) Received: by wyb33 with SMTP id 33so2970750wyb.19 for ; Tue, 22 Jun 2010 02:46:50 -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; bh=+Utb+qoOlhYRs/c0jYIAK3Xn5JznM7ktwMNIsNk1m2M=; b=UoEKa91DhrNZOkPop0qrmX4CICrDT9v8KJUaMUxkhoduxGlOktK588NiYUEUy8qn5I aIw9D7u9jjvRoGHW5YYrcwkSZ3W+q0HlQ+sA9x8huGlGjM9BSRe9pkyZmagImc6XlWiX SQaaalvCvJ1Ce3upBixahlIlhLnGnk5hgsWAY= 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; b=qWlU36CK7sCoE9WL+VUXKhELsWABdbz5zl8fSNe9sRDczfJ+swiIMu34TDmJ3FvlPD LO7FCehV7r+vjEUnfaS7C083lr5YeNiCIspyODiOG3QIZrqSqCWMeLea27aEtrpqB2ix FqTy1FVqyEwo+fNPPv7EoQFO4ltwhjnnSAYL8= Received: by 10.216.172.194 with SMTP id t44mr4441681wel.54.1277200010149; Tue, 22 Jun 2010 02:46:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.231.221 with HTTP; Tue, 22 Jun 2010 02:46:30 -0700 (PDT) In-Reply-To: <4C207B8B.4030104@gmail.com> References: <4C207403.3080103@gmail.com> <4C207B8B.4030104@gmail.com> From: Thom Brown Date: Tue, 22 Jun 2010 10:46:30 +0100 Message-ID: Subject: Re: INTEGER range ("-2147483648" is not accepted.) To: Satoshi Nagayasu Cc: Magnus Hagander , pgsql-docs Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.001 tagged_above=-5 required=5 tests=BAYES_20=-0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201006/47 X-Sequence-Number: 5615 On 22 June 2010 09:59, Satoshi Nagayasu wrote: > Magnus, > > Thanks for your advice. I've understood how it happens. > > However, it looks tricky and difficult to understand, > so I hope that the message could be more understandable > as Thom mentioned. > > Regards, > This does appear to be a gotcha, as the following returns a negative integer as expected: postgres=# SELECT -2147483648; ?column? ------------- -2147483648 (1 row) postgres=# SELECT pg_typeof(-2147483648); pg_typeof ----------- integer (1 row) And just in case... postgres=# SELECT pg_typeof(test.my_num) FROM (SELECT -2147483648) AS test(my_num); pg_typeof ----------- integer (1 row) So it's affected by the cast operator? Thom