Re: Bug with int2 - Mailing list pgsql-hackers

From Feng Tian
Subject Re: Bug with int2
Date
Msg-id CAFWGqnuCTPbVmFciBGCRc15HQZf3_pNXGrQhUg8hTR5E469W=A@mail.gmail.com
Whole thread
In response to Re: Bug with int2  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
Ah, thanks!

On Tue, Feb 16, 2016 at 7:54 PM, Peter Geoghegan <pg@heroku.com> wrote:
On Tue, Feb 16, 2016 at 7:27 PM, Feng Tian <ftian@vitessedata.com> wrote:
> I run into the following.   Seems this is a bug for -32768, which should be
> a valid smallint value.

This isn't a bug. You see the error only due to operator precedence:

postgres=# select (-32768)::int2;
  int2
─────────
 -32,768
(1 row)

--
Peter Geoghegan

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal: PL/Pythonu - function ereport
Next
From: Oleg Bartunov
Date:
Subject: Re: tsearch_extras extension