RE: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue

From: "Thangavel, Parameswaran" <Parameswaran(dot)Thangavel(at)rsa(dot)com>
To: Andreas Joseph Krogh <andreas(at)visena(dot)com>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: RE: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue
Date: 2020-10-20 06:43:55
Message-ID: CH2PR19MB3798DAEA77750DD4F4CE67A0831F0@CH2PR19MB3798.namprd19.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

When I run the select statement, I am getting different data...

What could be causing this?

Please note, when I change my driver to older version, then I don't see this issue.

[cid:image003(dot)jpg(at)01D6A6DA(dot)71D67610]

From: Andreas Joseph Krogh <andreas(at)visena(dot)com>
Sent: Tuesday, October 20, 2020 11:49 AM
To: Thangavel, Parameswaran
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Sv: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue

[EXTERNAL EMAIL]
På tirsdag 20. oktober 2020 kl. 05:21:51, skrev Thangavel, Parameswaran <Parameswaran(dot)Thangavel(at)rsa(dot)com<mailto:Parameswaran(dot)Thangavel(at)rsa(dot)com>>:
Hi Team,

I am using postgresql version 9.4.1. We are in the process of upgrading to PostgreSQL 10.

While doing so, we have upgraded the JDBC postgres driver from 9.1-901.jdbc4 to 42.2.5 Post the upgrade we are facing the issue with data integrity where the numeric value is getting rounded off.

Scenario:
I am trying to insert a value (float datatype in Java) and in DB it is represented as Numeric.

When I try to store, "1234567" the value is stored as "1234570".
No, it is stored as $4 = '1.234567e+06'
Which is correct as it is a 7-digit figure 1.234567 * 10^6.

--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
andreas(at)visena(dot)com<mailto:andreas(at)visena(dot)com>
www.visena.com<https://www.visena.com>
[cid:image002(dot)png(at)01D6A6DA(dot)71AE0680]<https://www.visena.com/>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Andreas Joseph Krogh 2020-10-20 06:46:40 RE: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue
Previous Message Andreas Joseph Krogh 2020-10-20 06:18:56 Sv: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue