Casting on the limit

From: Ottó Havasvölgyi <havasvolgyi(dot)otto(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Casting on the limit
Date: 2008-01-21 08:04:48
Message-ID: 34608c0c0801210004x29c8b037j5a6cf48ed193f4c6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

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.

Best regards,
Otto

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Ottó Havasvölgyi 2008-01-21 08:06:34 Re: Casting on the limit
Previous Message Tom Lane 2008-01-20 21:18:51 Re: psql's \h listing of commands doesn't look nice anymore