Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id B5FAB6328DF for ; Fri, 15 May 2009 04:13:12 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 06676-01 for ; Fri, 15 May 2009 04:13:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by mail.postgresql.org (Postfix) with ESMTP id 2E75363286F for ; Fri, 15 May 2009 04:13:09 -0300 (ADT) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1M4rbQ-0004wY-A2 for pgsql-jdbc@postgresql.org; Fri, 15 May 2009 00:13:08 -0700 Message-ID: <23554615.post@talk.nabble.com> Date: Fri, 15 May 2009 00:13:08 -0700 (PDT) From: Tanel To: pgsql-jdbc@postgresql.org Subject: Re: ResultSet getString() result differs in 8.3 jdbc (compared to 8.1), with "real" type In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: tanel.ehrenpreis@finestmedia.ee References: <23536933.post@talk.nabble.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200905/90 X-Sequence-Number: 19640 Kris Jurka wrote: > > > > On Thu, 14 May 2009, Tanel wrote: > >> I made some searches also, however found nothing exactly related to this >> problem. We just shifted from using 8.1 driver to 8.3 however seems that >> 8.3 >> driver handles differently Postgresql floating type values, when using >> org.postgresql.jdbc2.AbstractJdbc2ResultSet.java getString() on them ? >> For example, when there is "real" type value 20.7 in database and we try >> to >> get it through getString() then old 8.1 driver returns nicely 20.7, but >> new >> 8.3 driver is returning something like 20.700001. >> >> So my question would be that if such getString() behaviour is desired (?) >> (it is also in 8.4 driver), then can someone please give an hint where >> exactly can this behaviour be manipulated/turned off/etc... ? >> > > The setting that changed is extra_float_digits. The newer driver is > setting it to two rather than the default zero to restore float values as > accurately as possible. You can override this by issuing your own SET > command upon connection. > > http://www.postgresql.org/docs/8.3/static/runtime-config-client.html#RUNTIME-CONFIG-CLIENT-FORMAT > > Kris Jurka > > -- > Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-jdbc > > Hi, Thank you, that did it :) Actually when I debugged and compared the source codes of 8.1 and 8.3 I noticed and experimented with that value also, but as there are v2 and v3 ConnectionFactoryImpl.java, then somehow I missed the latter one, probably the day was already too long by that time :) Tanel. -- View this message in context: http://www.nabble.com/ResultSet-getString%28%29-result-differs-in-8.3-jdbc-%28compared-to-8.1%29%2C-with-%22real%22-type-tp23536933p23554615.html Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.