> I am getting output that doesn't make sense from a simple SQL statement.
> I am expecting to get a '0'::text returned by this statement, but
> instead I'm getting very, very small numbers, or other weird things.
> It's a catch for NULL values and isn't interpreting them correctly when
> it gets them.
For a float8 field "d", I can reproduce this with a slightly simpler
case:
lockhart=# select case when (d = null) then 0 else d end from t1;
text
------
0
(1 row)
lockhart=# select case when (d = null) then '0' else d end from t1;
text
-----------------------
1.11784577978351e+253
(1 row)
I haven't tracked it down, but I'll guess that the automatic type
conversion logic is getting confused with the stringy form of zero.
I do not see the symptom in the current development tree.
- Thomas