More information to add to this bug.
I get the same behavior as the original poster, but the following on these
queries:
sszabo=> select myfloat-29.92 from "test_f4";
?column?
----------------------
7.62939436071974e-08
7.62939436071974e-08
(2 rows)
sszabo=> select myfloat-'29.92' from "test_f4";
?column?
----------
0
0
(2 rows)
This is probably due to the float constant being made
a float8 since I also see the following:
sszabo=> select 29.92::float4-29.92::float8;
?column?
----------------------
7.62939436071974e-08
(1 row)
On Tue, 24 Jul 2001 pgsql-bugs@postgresql.org wrote:
> CREATE TABLE "test_r" ("key" serial, "myfloat" real);
> CREATE TABLE "test_f" ("key" serial, "myfloat" float8);
> CREATE TABLE "test_f4" ("key" serial, "myfloat" float4);
> INSERT INTO "test_r" ("myfloat") values ('29.92');
> INSERT INTO "test_r" ("myfloat") values (29.92);
> INSERT INTO "test_f" ("myfloat") values ('29.92');
> INSERT INTO "test_f" ("myfloat") values (29.92);
> INSERT INTO "test_f4" ("myfloat") values ('29.92');
> INSERT INTO "test_f4" ("myfloat") values (29.92);