Re: Bug with int2

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Feng Tian <ftian(at)vitessedata(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug with int2
Date: 2016-02-17 03:54:00
Message-ID: CAM3SWZSF48rewhssD4h+wUDvoA32Yz275S5_HY9ysjmLOHNm_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 16, 2016 at 7:27 PM, Feng Tian <ftian(at)vitessedata(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tim Abbott 2016-02-17 03:57:31 Re: tsearch_extras extension
Previous Message Michael Paquier 2016-02-17 03:46:25 Re: Bug with int2