Re: 'real' strange problem in 7.1.3

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Tony Reina <reina(at)nsi(dot)edu>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 'real' strange problem in 7.1.3
Date: 2001-11-09 20:17:19
Message-ID: 20011109121450.Q58847-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> 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
> -----
> L
> R
> (2 rows)
>
> which is correct.

The reason is that in the first, the 1.8 is treated as double precision
which is slightly different than the 1.8 as real (you can see this with
a select 1.8::real-1.8;). I think the second postpones deciding the type
and gets converted into a 1.8 as real.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Doug McNaught 2001-11-09 20:25:04 Re: Possible major bug in PlPython (plus some other ideas)
Previous Message Trond Eivind =?iso-8859-1?q?Glomsr=F8d?= 2001-11-09 20:14:13 Re: Possible major bug in PlPython (plus some other ideas)