select real returns nothing

From: Chris Sutton <chris(at)ifloor(dot)com>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: select real returns nothing
Date: 2002-06-12 21:51:32
Message-ID: Pine.LNX.4.33.0206121434200.19119-100000@zev.ifloor.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I'm getting some weird things happen when trying to search for a specific row in a table that contains "real" types.

Here is my table structure

table units (
unit_id int4,
price_unit varchar(10),
unit_cov real,
unit_wt real);

The following row exists in the units table

unit_id | price_unit | unit_cov | unit_wt
---------+------------+----------+---------
47430 | LF | 12 | 4.833

The following query returns no rows:

SELECT unit_id FROM units
WHERE price_unit='LF' and unit_cov=12 and unit_wt=4.833;

While these queries return the correct unit_id

SELECT unit_id FROM units
WHERE price_unit='LF' and unit_cov='12' and unit_wt='4.833';

SELECT unit_id FROM units
WHERE price_unit='LF' and unit_cov='12' and unit_wt=float4(4.833);

I'm running pg7.2.1 on Linux.

The curious thing is I have a development database running pg7.1 on linux where I don't have this problem.

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2002-06-12 22:48:26 Bug #691: CREATE TABLE AS ignores explicit column names with UNION
Previous Message Bruce Momjian 2002-06-12 17:29:33 Re: [BUGS] createdb comments