Casting on the limit - Mailing list pgsql-bugs

From Ottó Havasvölgyi
Subject Casting on the limit
Date
Msg-id 34608c0c0801210004x29c8b037j5a6cf48ed193f4c6@mail.gmail.com
Whole thread Raw
Responses Re: Casting on the limit
Re: Casting on the limit
List 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


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: psql's \h listing of commands doesn't look nice anymore
Next
From: "Ottó Havasvölgyi"
Date:
Subject: Re: Casting on the limit