ResultSet getString() result differs in 8.3 jdbc (compared to 8.1), with "real" type

From: Tanel <tanel(dot)ehrenpreis(at)finestmedia(dot)ee>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: ResultSet getString() result differs in 8.3 jdbc (compared to 8.1), with "real" type
Date: 2009-05-14 09:10:45
Message-ID: 23536933.post@talk.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


Hi,

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.

As "real" is floating type value then presumably this long 20.700001 can
indeed be how database is holding value 20.7 ? However when I was comparing
8.1 and 8.3 driver sources then no changes that could have caused it caught
my eye...
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... ?

(NB! yes, the correct way would be to use getFloat() ofcourse)

Regards,
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-tp23536933p23536933.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Guillaume Cottenceau 2009-05-14 16:40:56 Re: ResultSet getString() result differs in 8.3 jdbc (compared to 8.1), with "real" type
Previous Message Dave Cramer 2009-05-13 22:31:03 Re: pooled prepared statements