Re: Weird type selection choice - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Weird type selection choice
Date
Msg-id 200711061816.10346.peter_e@gmx.net
Whole thread Raw
In response to Re: Weird type selection choice  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Weird type selection choice
List pgsql-hackers
Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > It apparently casts the 1 to double precision to pick the variant
> > trunc(dp)=>dp instead of trunc(numeric)=>numeric.  I was under the
> > impression that we didn't want to cast integers to float types
> > implicitly because this loses information.  Clearly, the numeric
> > variant should be preferred anyway.
>
> There's nothing "clear" about that at all.

The clarity stems from the fact that this is the variant that doesn't 
lose data whereas the other one does.

The expression I originally posted works on Oracle.  I wonder how they 
do it.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: regtype sorting broken in 8.3
Next
From: Jeff Davis
Date:
Subject: Re: Visibility map thoughts