Per Postgres documentation, an integer
type is defined between -2147483648
and +2147483647
.
I thought that these boundaries were inclusive, but if I try:
select -2147483648 = -2147483648::int4
提高Integer out of range error
.
上限似乎被正确设定:
# select 2147483647 = 2147483647::int4;
?column?
----------
t
(1 row)
如果我将下限增加一,它也可以正常工作:
# select -2147483647 = -2147483647::int4;
?column?
----------
t
(1 row)
同样的结果适用于smallint
.