Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wwvzd-00022Y-W1 for pgsql-odbc@arkaria.postgresql.org; Tue, 17 Jun 2014 16:12:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wwvzd-0002zG-82 for pgsql-odbc@arkaria.postgresql.org; Tue, 17 Jun 2014 16:12:17 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Wwvzc-0002z7-8f for pgsql-odbc@postgresql.org; Tue, 17 Jun 2014 16:12:16 +0000 Received: from dub004-omc2s20.hotmail.com ([157.55.1.159]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WwvzW-0003nX-3N for pgsql-odbc@postgresql.org; Tue, 17 Jun 2014 16:12:14 +0000 Received: from DUB121-W31 ([157.55.1.136]) by DUB004-OMC2S20.hotmail.com with Microsoft SMTPSVC(7.5.7601.22701); Tue, 17 Jun 2014 09:12:07 -0700 X-TMN: [mOMFwG9WHSABxITdBhqUkCRMYvfZdON0] X-Originating-Email: [nukemd@hotmail.com] Message-ID: From: John Smith To: "Inoue, Hiroshi" CC: "pgsql-odbc@postgresql.org" Subject: Re: Precision problems with storage of float/double Date: Tue, 17 Jun 2014 18:12:07 +0200 Importance: Normal In-Reply-To: <539FB503.3090103@tpf.co.jp> References: , <539FB503.3090103@tpf.co.jp> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 17 Jun 2014 16:12:07.0781 (UTC) FILETIME=[E3001150:01CF8A46] X-Pg-Spam-Score: -2.9 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org Hi Hiroshi I googled this a little, and I think you are right. 17 and 9 should be enou= gh. I don't have any problems with you changing the patch. ---------------------------------------- > Date: Tue, 17 Jun 2014 12:24:51 +0900 > From: inoue@tpf.co.jp > To: nukemd@hotmail.com > CC: pgsql-odbc@postgresql.org > Subject: Re: [ODBC] Precision problems with storage of float/double > > (2014/06/16 1:51), John Smith wrote: >> Hi, >> >> I have found that floats and doubles that I save to the database with th= e ODBC driver may lose precision. The exact bit pattern of my double/float = is not what is actually saved in the database. This causes difficulties in = situations where you need to compare current record contents with the actua= l data that was inserted. >> >> It appears to be related to conversion from the double/float to text bef= ore it is sent to the database. >> >> I made a simple patch that appears to fix the issue (by adding more deci= mal digits in the string conversion), and a test case that tests the issue. > > Thanks. > > As far as I examined, 9 decimal digits for 32-bit reals and 17 decimal > digits for 64-bit doubles are sufficient to guarantee the complete > recovery. > Is it OK to change decimal digits in your patch to those ones? > > Hmm I noticed that server's output should be changed in addition > to this change. The setting of extra_float_digits should be changed > from 2 to 3. > > regards, > Hiroshi Inoue > > > > -- > I am using the free version of SPAMfighter. > SPAMfighter has removed 10915 of my spam emails to date. > Get the free SPAMfighter here: http://www.spamfighter.com/len > > Do you have a slow PC? Try a Free scan > http://www.spamfighter.com/SLOW-PCfighter?cid=3Dsigen > =20=09=09=20=09=20=20=20=09=09=20=20 --=20 Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc