BUG #1526: SHRT_MIN out of range on explicit type conversion

Поиск
Список
Период
Сортировка
От Kelly Burkhart
Тема BUG #1526: SHRT_MIN out of range on explicit type conversion
Дата
Msg-id 20050304201406.BF74DF176F@svr2.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #1526: SHRT_MIN out of range on explicit type conversion  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      1526
Logged by:          Kelly Burkhart
Email address:      pgkrb@kkcsm.net
PostgreSQL version: 7.4.2
Operating system:   SuSE Linux 9.1   i386 & x86-64
Description:        SHRT_MIN out of range on explicit type conversion
Details:

An explicit type conversion of an integer constant representing the minimum
value that type can hold results in an 'integer out of range' error.

From psql, the following will fail:

select -32768::int2;
select -2147483648::int4;
select -9223372036854775808::int8;

If the constants are strings, there is no failure.  For instance the
following will succeed:

select '-32768'::int2;
select '-2147483648'::int4;
select '-9223372036854775808'::int8;

Also increasing the value by one does not result in failure.  The following
will succeed:

select -32767::int2;
select -2147483647::int4;
select -9223372036854775807::int8;

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

Предыдущее
От: "Dennis van Dok"
Дата:
Сообщение: BUG #1524: drop view cascade deletes other user's views
Следующее
От: "Ivan Chumak"
Дата:
Сообщение: BUG #1520: messages in Russian is made wrong