Re: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue - Mailing list pgsql-jdbc

From David G. Johnston
Subject Re: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue
Date
Msg-id CAKFQuwbbYTc63HeEBPXcDzPU28Do4z+y9ZEwQKVFwCnbPP1FaQ@mail.gmail.com
Whole thread Raw
In response to RE: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue  (Andreas Joseph Krogh <andreas@visena.com>)
Responses Re: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue  (Andreas Joseph Krogh <andreas@visena.com>)
List pgsql-jdbc
On Mon, Oct 19, 2020 at 11:46 PM Andreas Joseph Krogh <andreas@visena.com> wrote:
På tirsdag 20. oktober 2020 kl. 08:43:55, skrev Thangavel, Parameswaran <Parameswaran.Thangavel@rsa.com>:

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

I suggest you use the native "psql"-client and chech the results from that first.

Specifically this behavior can be readily observed using the following query:

SELECT '1.234567+e06'::float4::numeric;

As I mentioned in the original -bugs report for this issue [1] I don't know whether the above is correct or not.  What I can say is the regression demonstrated in the example Java program could be readily avoided by not passing around floating point values when the database storage is numeric.

Since the confusing behavior can be shown using just PostgreSQL the original bug report suffices as a place to get the final explanation as to what is going on here.

David J.


pgsql-jdbc by date:

Previous
From: Andreas Joseph Krogh
Date:
Subject: RE: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue
Next
From: Andreas Joseph Krogh
Date:
Subject: Re: PostgresSQL 10 | Driver 42.2.5 | Float Conversion Issue