> select -(32768::smallint)
>
> which is why you're getting "smallint out of range." This should work:
>
> select (-32768)::smallint
Exact. Thank you for the answer.
But really conter-intuitive.
Cordialement,
Jean-Gérard Pailloncy
--
Hi,
On PostgreSQL 8.1.2
select -32768::smallint
throws the error
ERROR: smallint out of range
select -32767::smallint
is OK.
The documentation states that -32768 is OK.
http://www.postgresql.org/docs/8.1/interactive/datatype.html#DATATYPE-NUMERIC
Cordialement,
Jean-Gérard Pailloncy