Thread: Float/Numeric?

Float/Numeric?

From
Michael Meskes
Date:
Could anyone tell me why the following does not work without a cast?

mm=> select * from test;    f|i|a
------+-+---------------------
404.90|1|{0,1,2,3,4,5,6,7,8,9}
(1 row)

mm=> select i from test where f=404.90
mm-> ;
ERROR:  Unable to identify an operator '=' for types 'numeric' and 'float8'       You will have to retype this query
usingan explicit cast
 
mm=> select i from test where f::float=404.90;
i
-
1
(1 row)

Shouldn't there be an implicit cast between numeric and float?

Michael
-- 
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De           | Use PostgreSQL!


Re: [HACKERS] Float/Numeric?

From
Thomas Lockhart
Date:
> Shouldn't there be an implicit cast between numeric and float?

Yes there should. I'll add it to my list for v7.0 unless someone beats
me to it...
                       - Thomas

-- 
Thomas Lockhart                lockhart@alumni.caltech.edu
South Pasadena, California