Re: INTEGER range ("-2147483648" is not accepted.)

From: Thom Brown <thombrown(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Fetter <david(at)fetter(dot)org>, Satoshi Nagayasu <satoshi(dot)nagayasu(at)gmail(dot)com>, pgsql-docs(at)postgresql(dot)org
Subject: Re: INTEGER range ("-2147483648" is not accepted.)
Date: 2010-06-23 08:17:58
Message-ID: AANLkTilq-UVd-seYgasLkH4TjRwG8WHTw-EhLxyyxOQD@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On 23 June 2010 02:49, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Thom Brown <thombrown(at)gmail(dot)com> writes:
>> Is that the right behaviour though?  Shouldn't the signed value reach
>> the cast step rather than the absolute value?  Or maybe Postgres could
>> implicitly accept -12345::integer to be (-12345)::integer.  Is there a
>> blocking reason as to why it must work this way?
>
> Yes.  There is no reason to assume that - means the same thing for every
> datatype.  In general, :: should (and does) bind tighter than *every*
> operator, to ensure that the appropriately typed operator is applied.
>

Okay. I'll admit that this won't be a common case, but could the
error message make reference to the value it took?

Thom

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Mike Toews 2010-06-23 14:29:49 Re: INTEGER range ("-2147483648" is not accepted.)
Previous Message Tom Lane 2010-06-23 01:49:37 Re: INTEGER range ("-2147483648" is not accepted.)