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

From NWRFC Portland
Subject Postgres 9.2.4 "Double Precision" Precision
Date
Msg-id CABf4AP2Aa+fMMMvOqBRDF74LrpBNiTx-r2Ucp7gKn9-tHhkhPg@mail.gmail.com
Whole thread Raw
Responses Re: Postgres 9.2.4 "Double Precision" Precision  (Adrian Klaver <adrian.klaver@gmail.com>)
List pgsql-general
I recently upgraded from postgres 8.2.6 to 9.2.4 . For the most part I am enjoying the upgrade.  I have found one behavior that I can not explain.....

Below is sample contents of a table.  "VALUE" in column 7 is defined as double precision (table definition is the same in 8.2.6 as 9.2.4).
The change over from 8.2.6 to 9.2.4 happened after 2013-09-10 16:00:00.

In postgres 8.2.6 a value inserted , 6.31, is represented in the database as 6.31 (7th column,7th row)
In postgres 9.2.4 a value inserted , 6.32, is represented in the database as 6.32000017166138 (7th column, 6th row)

                                                              VALUE
 SLMO3 | HG |   0 | RG | Z        | 2013-09-10 18:15:00 | 6.32000017166138 | Z              |   1879048191 |        0 | MSGPRODID  | 2013-09-10 20:02:00 | 2013-09-10 20:03:15
 SLMO3 | HG |   0 | RP | Z        | 2013-09-10 18:15:00 | 6.32999992370605 | Z              |   1879048191 |        0 | KPQRRR6PQR | 2013-09-10 19:15:00 | 2013-09-10 19:15:34
 SLMO3 | HG |   0 | RP | Z        | 2013-09-10 18:00:00 | 6.32999992370605 | Z              |   1879048191 |        0 | KPQRRR6PQR | 2013-09-10 18:18:00 | 2013-09-10 18:18:12
 SLMO3 | HG |   0 | RP | Z        | 2013-09-10 17:45:00 | 6.32999992370605 | Z              |   1879048191 |        0 | KPQRRR6PQR | 2013-09-10 18:18:00 | 2013-09-10 18:18:12
 SLMO3 | HG |   0 | RP | Z        | 2013-09-10 17:30:00 | 6.32000017166138 | Z              |   1879048191 |        0 | KPQRRR6PQR | 2013-09-10 18:18:00 | 2013-09-10 18:18:12
 SLMO3 | HG |   0 | RP | Z        | 2013-09-10 17:15:00 | 6.32000017166138 | Z              |   1879048191 |        0 | KPQRRR6PQR | 2013-09-10 18:18:00 | 2013-09-10 18:18:12
 SLMO3 | HG |   0 | RP | Z        | 2013-09-10 16:00:00 |             6.31 | Z              |   1879048191 |        0 | KPQRRR6PQR | 2013-09-10 16:18:23 | 2013-09-10 16:18:23
 SLMO3 | HG |   0 | RG | Z        | 2013-09-10 16:00:00 |             6.28 | Z              |   1879048191 |        0 | KWOHRRSPTR | 2013-09-10 16:16:32 | 2013-09-10 16:17:33
 SLMO3 | HG |   0 | RG | Z        | 2013-09-10 15:45:00 |             6.28 | Z              |   1879048191 |        0 | KWOHRRSPTR | 2013-09-10 16:16:32 | 2013-09-10 16:17:33
 SLMO3 | HG |   0 | RP | Z        | 2013-09-10 15:45:00 |             6.31 | Z              |   1879048191 |        0 | KPQRRR6PQR | 2013-09-10 16:18:23 | 2013-09-10 16:18:23
 SLMO3 | HG |   0 | RP | Z        | 2013-09-10 15:30:00 |             6.31 | Z              |   1879048191 |        0 | KPQRRR6PQR | 2013-09-10 16:18:23 | 2013-09-10 16:18:23
 SLMO3 | HG |   0 | RG | Z        | 2013-09-10 15:30:00 |             6.27 | Z              |   1879048191 |        0 | KWOHRRSPTR | 2013-09-10 16:16:32 | 2013-09-10 16:17:33


As the values effect arithmetic calculations, I wish the database to represent values as they are given.  For instance, 6.345 would be represented as 6.345.....  6.3 represented as 6.3.
Does anyone have any suggestions?

Thanks in advance,
Joanne

pgsql-general by date:

Previous
From: Igor Neyman
Date:
Subject: Re: Major upgrade of PostgreSQL and MySQL
Next
From: Adrian Klaver
Date:
Subject: Re: Postgres 9.2.4 "Double Precision" Precision