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=#