Precision problems with storage of float/double - Mailing list pgsql-odbc

From John Smith
Subject Precision problems with storage of float/double
Date
Msg-id DUB121-W17AD73873B390AF3AEF384D3170@phx.gbl
Whole thread Raw
Responses Re: Precision problems with storage of float/double  ("Inoue, Hiroshi" <inoue@tpf.co.jp>)
List pgsql-odbc
Hi,

I have found that floats and doubles that I save to the database with the ODBC driver may lose precision. The exact bit
patternof my double/float is not what is actually saved in the database. This causes difficulties in situations where
youneed to compare current record contents with the actual data that was inserted. 

It appears to be related to conversion from the double/float to text before it is sent to the database.

I made a simple patch that appears to fix the issue (by adding more decimal digits in the string conversion), and a
testcase that tests the issue. 



Attachment

pgsql-odbc by date:

Previous
From: John Smith
Date:
Subject: Re: SQL_DATA_AT_EXEC fails for SQL_C_BIGINT and SQL_C_NUMERIC
Next
From: Craig Ringer
Date:
Subject: Re: Building psqlODBC installers