Weird type selection choice - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Weird type selection choice
Date
Msg-id 200711061631.06129.peter_e@gmx.net
Whole thread Raw
Responses Re: Weird type selection choice  (Bernd Helmle <mailings@oopsware.de>)
Re: Weird type selection choice  (Peter Eisentraut <peter_e@gmx.net>)
Re: Weird type selection choice  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Weird type selection choice  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
I noticed this problem in 8.2 and 8.3:

pei=# select mod( trunc( 1 ), 2 );
ERROR:  42883: function mod(double precision, integer) does not exist
LINE 1: select mod( trunc( 1 ), 2 );              ^

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.  
What's wrong here?

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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: should I worry?
Next
From: Peter Eisentraut
Date:
Subject: regtype sorting broken in 8.3