Feng Tian <ftian@vitessedata.com> writes:
> I run into the following. Seems this is a bug for -32768, which should be
> a valid smallint value.
> ftian=# select -32768::int2;
> ERROR: smallint out of range
You have the wrong idea about the precedence of those operators.
"select (-32768)::int2" works.
regards, tom lane