Re: real or float4 '=' operator is broken in 7.1.2 - Mailing list pgsql-bugs

From Stephan Szabo
Subject Re: real or float4 '=' operator is broken in 7.1.2
Date
Msg-id Pine.BSF.4.21.0107241037220.68755-100000@megazone23.bigpanda.com
Whole thread Raw
In response to real or float4 '=' operator is broken in 7.1.2  (pgsql-bugs@postgresql.org)
List pgsql-bugs
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);

pgsql-bugs by date:

Previous
From: pgsql-bugs@postgresql.org
Date:
Subject: real or float4 '=' operator is broken in 7.1.2
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: insert of date is wrong