Ottó Havasvölgyi wrote:
In 8.2.5:

This does not work (out of range):
select -32768::int2

But this works:
select cast(-32768 as int2);

What is the difference between the two syntax in the background? I
always thought they are the same.

"select -32768::int2" is equal to "select -(32768::int2)", and 32768 doesn't fit in an int2.

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

              http://www.postgresql.org/docs/faq

Reply via email to