Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 0E9081337B92 for ; Thu, 10 Feb 2011 19:38:57 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 25757-01 for ; Thu, 10 Feb 2011 23:38:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mail.postgresql.org (Postfix) with ESMTP id 658F71337B8D for ; Thu, 10 Feb 2011 19:38:56 -0400 (AST) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id p1ANcu81035424 for ; Thu, 10 Feb 2011 23:38:56 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id p1ANcupQ035423; Thu, 10 Feb 2011 23:38:56 GMT (envelope-from www) Date: Thu, 10 Feb 2011 23:38:56 GMT Message-Id: <201102102338.p1ANcupQ035423@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #5880: Rounding error when copying a REAL numeric value to DOUBLE PRECISION From: "brad" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201102/103 X-Sequence-Number: 29375 The following bug has been logged online: Bug reference: 5880 Logged by: brad Email address: smithbs@gmail.com PostgreSQL version: 8.4.5 Operating system: linux x64 Description: Rounding error when copying a REAL numeric value to DOUBLE PRECISION Details: Steps to recreate are below. The real value is improperly rounded when inserted into a field that is double. 94.31 is stored as 94.3099975585938 when it is inserted into a double precision column. CREATE TABLE tmpfloatToDouble (field1 DOUBLE PRECISION, field2 REAL); INSERT INTO tmpfloatToDouble(field1, field2) VALUES(94.31, 94.31); INSERT INTO tmpfloatToDouble(field1, field2) select field2, field1 FROM tmpfloatToDouble; SELECT * FROM tmpfloattodouble;