The following bug has been logged online:
Bug reference: 1444
Logged by: Ioseph Kim
Email address: pgsql-kr(at)postgresql(dot)or(dot)kr
PostgreSQL version: 7.4x ~
Operating system: ALL
Description: ::int2 parser bug
Details:
> select int2(-32768);
int2
--------
-32768
--------------------------
> select -32768::int2;
ERROR: integer out of range
--------------------------
> select '-32768'::int2;
int2
--------
-32768
--------------------------
It seems to bug.
This bug occured ::int4 parsing too.