Re: Weird type selection choice

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Weird type selection choice
Date: 2007-11-06 17:16:09
Message-ID: 200711061816.10346.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)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/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2007-11-06 17:19:14 Re: Visibility map thoughts
Previous Message Tom Lane 2007-11-06 16:59:34 Re: regtype sorting broken in 8.3