Re: Postgres 9.2.4 "Double Precision" Precision - Mailing list pgsql-general

From Kevin Grittner
Subject Re: Postgres 9.2.4 "Double Precision" Precision
Date
Msg-id 1379173862.16828.YahooMailNeo@web162903.mail.bf1.yahoo.com
Whole thread Raw
In response to Re: Postgres 9.2.4 "Double Precision" Precision  (Adrian Klaver <adrian.klaver@gmail.com>)
Responses Re: Postgres 9.2.4 "Double Precision" Precision  (Adrian Klaver <adrian.klaver@gmail.com>)
List pgsql-general
Adrian Klaver <adrian.klaver@gmail.com> wrote:

> create table float_test (id int, f_fld double precision);
> insert into  float_test values (1, 6.31);
> insert into  float_test values (2, 6.32);
> select * from float_test ;
>
>   id | f_fld
> ----+-------
>   1 |  6.31
>   2 |  6.32
> (2 rows)

If, instead of those inserts I use these:

insert into  float_test values (1, '6.31');
insert into  float_test values (1, '6.32');
insert into  float_test values (1, '6.32'::double precision);
insert into  float_test values (1, '6.32'::real);

I get:

 id |      f_fld      
----+------------------
  1 |             6.31
  1 |             6.32
  1 |             6.32
  1 | 6.32000017166138
(4 rows)

Apparently the value is being treated as a real value somewhere.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-general by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: Small PosgreSQL locking function request - with bounty
Next
From: Adrian Klaver
Date:
Subject: Re: Postgres 9.2.4 "Double Precision" Precision