Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id D799B632F79 for ; Wed, 23 Jun 2010 11:30:18 -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 59524-06 for ; Wed, 23 Jun 2010 14:30:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gy0-f174.google.com (mail-gy0-f174.google.com [209.85.160.174]) by mail.postgresql.org (Postfix) with ESMTP id BD74F632F3F for ; Wed, 23 Jun 2010 11:30:11 -0300 (ADT) Received: by gye5 with SMTP id 5so3634572gye.19 for ; Wed, 23 Jun 2010 07:30:10 -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=K0tJdQLhaxCnXLhOAJXS5xYQ6324uYnIwQ2hk3o6Gy4=; b=mkdSW4+WWND804UabTxbNikC/1AmacFD/7nA2zonVN56JU75ol47uhbn4ODzqOixvA lS+ADJJwvJgtaho2SuuMdMhkGvxf+UQIgKT8yRD7KRlbvrl45QOvkJnrehq18GHwAMYU 2Qn/z1EJwfdPhV1SIPlG9rUk71C0gzk95G++4= 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=AzTDELTzQ0hGYV8dc1MTpIFDSLh3SgyJdr+vW6aQOomIHHdxNgR/LjMGqT1LK2IP/R 2JVf51CC6ds77E7uiyyMbBCBJT7apzy+xqar/YANAqOeFa0cstidg+hGjFSx4xlpT4pd U43CUuZnLQ84esAlYrm+zBktlsXV0yDkAdnKo= Received: by 10.151.25.7 with SMTP id c7mr7867717ybj.227.1277303409313; Wed, 23 Jun 2010 07:30:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.151.106.5 with HTTP; Wed, 23 Jun 2010 07:29:49 -0700 (PDT) In-Reply-To: <11645.1277257777@sss.pgh.pa.us> References: <4C207403.3080103@gmail.com> <20100622230754.GE15203@fetter.org> <11645.1277257777@sss.pgh.pa.us> From: Mike Toews Date: Wed, 23 Jun 2010 07:29:49 -0700 Message-ID: Subject: Re: INTEGER range ("-2147483648" is not accepted.) To: Tom Lane Cc: Thom Brown , David Fetter , Satoshi Nagayasu , 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 X-Spam-Level: X-Archive-Number: 201006/59 X-Sequence-Number: 5627 On 22 June 2010 18:49, Tom Lane wrote: > Thom Brown writes: >> Is that the right behaviour though? =A0Shouldn't the signed value reach >> the cast step rather than the absolute value? =A0Or maybe Postgres could >> implicitly accept -12345::integer to be (-12345)::integer. =A0Is there a >> blocking reason as to why it must work this way? > > Yes. =A0There is no reason to assume that - means the same thing for ever= y > datatype. =A0In general, :: should (and does) bind tighter than *every* > operator, to ensure that the appropriately typed operator is applied. > Sorry for adding to the non-DOC drift, but why is - assumed to be a unary operator on an unsigned integer, rather than parsed as part of an integer? Integers have digits with an optional - or + prefix (not unary operators). E.g., ([+\-]?[0-9]+) -Mike