Re: SELECT with REAL... - Mailing list pgsql-general

From Michael Glaesemann
Subject Re: SELECT with REAL...
Date
Msg-id 7F43CF0E-1A5B-4649-9442-3DFAE2D17191@myrealbox.com
Whole thread Raw
In response to SELECT with REAL...  (Philippe Ferreira <phil.f@worldonline.fr>)
List pgsql-general
On Feb 6, 2006, at 7:30 , Philippe Ferreira wrote:

> For example, the following command always returns 0 row, even if
> rows with myreal=10.5 do exist :
>     SELECT * FROM mytable WHERE myreal=10.5;
>
> Where am I wrong ?!

Without seeing a more complete example, it's hard to say. It works
for me here:
create table real_test
(
     real_label text primary key
     , real_value real not null unique
);

copy real_test (real_label, real_value) from stdin;
foo    1.2
bar    10.53
baz    10.5
bat    -54.3
\.


test=# select * from real_test;
real_label | real_value
------------+------------
foo        |        1.2
bar        |      10.53
baz        |       10.5
bat        |      -54.3
(4 rows)

test=# select * from real_test where real_value >= 10.5;
real_label | real_value
------------+------------
bar        |      10.53
baz        |       10.5
(2 rows)

test=# select * from real_test where real_value = 10.5;
real_label | real_value
------------+------------
baz        |       10.5
(1 row)

test=# select version();

version
------------------------------------------------------------------------
----------------------------------------------------------------------
PostgreSQL 8.1.0 on powerpc-apple-darwin8.3.0, compiled by GCC
powerpc-apple-darwin8-gcc-4.0.0 (GCC) 4.0.0 (Apple Computer, Inc.
build 5026)
(1 row)


Michael Glaesemann
grzm myrealbox com




pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: logging settings
Next
From: Steve Atkins
Date:
Subject: Re: SELECT with REAL...