Re: Bug with int2

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Bug with int2
Дата
Msg-id CAB7nPqTkExBp3FE5wBhhoH6QiQ0Cx-GgqcuzZm+SXgxocq6XxA@mail.gmail.com
обсуждение исходный текст
Ответ на Bug with int2  (Feng Tian <ftian@vitessedata.com>)
Список pgsql-hackers
On Wed, Feb 17, 2016 at 12:27 PM, Feng Tian <ftian@vitessedata.com> wrote:
> ftian=# select -32768::int2;
> ERROR:  smallint out of range

But 32768 is not. You should just use parenthesis, a cast does not
take into account the minus sign here:
=# select (-32768)::int2; int2
---------32768
(1 row)
-- 
Michael



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Bug with int2
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: Bug with int2