Hi, <br /><br />Consider the following with latest CVS sources:<br /><br />postgres=# create table temp(val float4);<br
/>CREATETABLE<br />postgres=# insert into temp values (415.1);<br />INSERT 0 1<br />postgres=# select * from temp where
val= 415.1;<br /> val<br />-----<br />(0 rows)<br /><br />!?<br /><br />The reason seems to be that 415.1 ends up
beingtreated as a numeric and is converted into float8 (why not float4? - it could have helped to use the float4eq
functionthen) <br clear="all" /><br />The float8in function uses strtod which for some reason converts '415.1' into
415.10000000000002causing the subsequent comparison to fail. I guess there are ample cases of float/strtod weirdness
around?Needless to mention, I was mighty surprised on seeing the output for the first time around :)<br /><br />Casting
tofloat4 works as expected:<br />postgres=# select * from rel where x = 415.1::float4;<br /> x<br />-------<br
/> 415.1<br/>(1 row)<br /><br />Regards,<br /> Nikhils<br />-- <br /><a href="http://www.enterprisedb.com"
target="_blank">http://www.enterprisedb.com</a><br/>