Re: Bug with int2 - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Bug with int2
Date
Msg-id CAM3SWZSF48rewhssD4h+wUDvoA32Yz275S5_HY9ysjmLOHNm_w@mail.gmail.com
Whole thread Raw
In response to Bug with int2  (Feng Tian <ftian@vitessedata.com>)
Responses Re: Bug with int2
List pgsql-hackers
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: Michael Paquier
Date:
Subject: Re: Bug with int2
Next
From: Tim Abbott
Date:
Subject: Re: tsearch_extras extension