Skip site navigation (1) Skip section navigation (2)

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thom Brown <thombrown(at)gmail(dot)com>
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 01:49:37
Message-ID: 11645.1277257777@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-docs
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.

			regards, tom lane

In response to

Responses

pgsql-docs by date

Next:From: Thom BrownDate: 2010-06-23 08:17:58
Subject: Re: INTEGER range ("-2147483648" is not accepted.)
Previous:From: Thom BrownDate: 2010-06-22 23:16:06
Subject: Re: INTEGER range ("-2147483648" is not accepted.)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group