'real' strange problem in 7.1.3 - Mailing list pgsql-hackers

From reina@nsi.edu (Tony Reina)
Subject 'real' strange problem in 7.1.3
Date
Msg-id f40d3195.0111091109.f6d003a@posting.google.com
Whole thread Raw
Responses Re: 'real' strange problem in 7.1.3
Re: 'real' strange problem in 7.1.3
List pgsql-hackers
I have a database in PG 7.1.3 with the following schema:

db02=# \d ellipse                 Table "ellipse"       Attribute         |     Type     | Modifier 
--------------------------+--------------+----------subject                  | text         | arm
|character(1) | rep                      | integer      | exp_date                 | date         | exp_time
    | time         | success                  | integer      | figure_radius            | integer      | tube_radius
         | integer      | cursor_radius            | integer      | direction                | integer      |
ellipse_ratio           | real         | exag_ratio               | real         | exag_start               | integer
  | exag_end                 | integer      | rotation_angle           | real         | min_inter_trial_interval |
integer     | 
 
Index: pkellipse

If I try the command:
db02=# select distinct arm from ellipse where exag_ratio = 1.0;arm 
-----LR
(2 rows)

which is correct.

Now I try the same command with a different 'real' field:
db02=# select distinct arm from ellipse where ellipse_ratio = 1.8;arm 
-----
(0 rows)

BUT, if I put the value in quotes (as if it were a string), I get:

db02=# select distinct arm from ellipse where ellipse_ratio = '1.8';arm 
-----LR
(2 rows)

which is correct.

This variable ellipse_ratio seems to be the only one of type 'real'
that requires me to use quotes (which doesn't really make sense since
it's not a character or string anyway). exag_ratio and rotation_angle
behave as I would expect a real-typed variable to behave.

db02=# select distinct exag_ratio, ellipse_ratio, rotation_angle from
ellipse;exag_ratio | ellipse_ratio | rotation_angle 
------------+---------------+----------------         1 |          0.56 |              0         1 |           1.8 |
         0
 
(2 rows)



Has anyone seen this behavior before? Perhaps, I'm doing something
wrong here or thinking of this all wrong?

Thanks.
-Tony Reina

Welcome to psql, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms      \h for help with SQL commands      \? for help on internal slash commands
    \g or terminate with semicolon to execute query      \q to quit
 

db02=# select version();                          version                           
-------------------------------------------------------------PostgreSQL 7.1.3 on i686-pc-linux-gnu, compiled by GCC
2.96
(1 row)

PG server is RH Linux 7.1 (Seawolf), PIII 400 MHz
Vacuum verbose analyze performed just prior to the searches listed
just to be sure.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Possible major bug in PlPython (plus some other ideas)
Next
From: Bradley McLean
Date:
Subject: Re: Possible major bug in PlPython (plus some other ideas)