Re: Postgres 9.2.4 "Double Precision" Precision

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>, Joanne Salerno - NOAA Federal <joanne(dot)salerno(at)noaa(dot)gov>
Cc: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Postgres 9.2.4 "Double Precision" Precision
Date: 2013-09-14 15:51:02
Message-ID: 1379173862.16828.YahooMailNeo@web162903.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adrian Klaver <adrian(dot)klaver(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2013-09-14 16:57:41 Re: Postgres 9.2.4 "Double Precision" Precision
Previous Message Kevin Grittner 2013-09-14 15:29:46 Re: Small PosgreSQL locking function request - with bounty