Bug with int2

From: Feng Tian <ftian(at)vitessedata(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Bug with int2
Date: 2016-02-17 03:27:23
Message-ID: CAFWGqntMsAAmeaQgBE40z6at9KrNHRxh__Y36mA5BdXsQXXU=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I run into the following. Seems this is a bug for -32768, which should be
a valid smallint value.

Test was run on 9.4.5.

Thanks,
Feng

ftian=# select 32767::int2;

int2
-------
32767
(1 row)

ftian=# select -32767::int2;
?column?
----------
-32767
(1 row)

ftian=# select 32768::int2;

ERROR: smallint out of range
ftian=# select -32768::int2;
ERROR: smallint out of range
ftian=#

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-02-17 03:44:03 Re: How are CREATE EXTENSION ... VERSION or ALTER EXTENSION ... UPDATE TO ... intended to work?
Previous Message Chapman Flack 2016-02-17 03:17:50 How are CREATE EXTENSION ... VERSION or ALTER EXTENSION ... UPDATE TO ... intended to work?