Re: Bug with int2 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bug with int2
Date
Msg-id 18526.1455680766@sss.pgh.pa.us
Whole thread Raw
In response to Bug with int2  (Feng Tian <ftian@vitessedata.com>)
List pgsql-hackers
Feng Tian <ftian@vitessedata.com> writes:
> I run into the following.   Seems this is a bug for -32768, which should be
> a valid smallint value.

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

You have the wrong idea about the precedence of those operators.
"select (-32768)::int2" works.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: How are CREATE EXTENSION ... VERSION or ALTER EXTENSION ... UPDATE TO ... intended to work?
Next
From: Michael Paquier
Date:
Subject: Re: Bug with int2