Re: real or float4 '=' operator is broken in 7.1.2

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: ddodsworth(at)navtechinc(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: real or float4 '=' operator is broken in 7.1.2
Date: 2001-07-24 17:43:27
Message-ID: Pine.BSF.4.21.0107241037220.68755-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)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);

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2001-07-24 18:21:02 insert of date is wrong
Previous Message pgsql-bugs 2001-07-24 16:30:13 real or float4 '=' operator is broken in 7.1.2