Re: integer input functions : interesting limit behaviour

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pierre Frédéric Caillaud <lists(at)peufeu(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: integer input functions : interesting limit behaviour
Date: 2009-09-08 14:25:05
Message-ID: 25882.1252419905@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?utf-8?Q?Pierre_Fr=C3=A9d=C3=A9ric_Caillau?= =?utf-8?Q?d?= <lists(at)peufeu(dot)com> writes:
> * Here, the most negative value is sometimes accepted, sometimes not :

> test=> SELECT -2147483648::INTEGER;
> ERREUR: entier en dehors des limites

You're confused about the operator precedence: the above is
treated as -(2147483648::INTEGER) so of course it fails.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2009-09-08 14:38:20 Re: Triggers on columns
Previous Message Stuart Bishop 2009-09-08 14:17:12 Re: Time-based Releases WAS: 8.5 release timetable, again