Re: some problem with casting unknown to smallint

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Cc: "postgres hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: some problem with casting unknown to smallint
Date: 2008-10-29 12:44:07
Message-ID: 11408.1225284247@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> writes:
> I understand. So every smallint should be call with casting?

A long time ago we tried to make small integer literals be interpreted
as int2 initially, instead of int4, and the attempt failed rather
spectacularly. (It broke most of the regression tests, IIRC, in ways
that suggested that many client applications would have problems too.)
Perhaps PG's type system has matured to the point where it'd work better
now, but I'm not really interested in trying it. I don't see very much
point in declaring functions to take smallint rather than int anyway...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2008-10-29 12:52:41 Re: some problem with casting unknown to smallint
Previous Message Tom Lane 2008-10-29 12:36:54 Re: Updating FSM on recovery