Re: Change of format of returned flat value after prepareThreshold

From: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
To: Michał Niklas <michal(dot)niklas(at)heuthes(dot)pl>
Cc: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Change of format of returned flat value after prepareThreshold
Date: 2015-10-15 15:34:50
Message-ID: CAB=Je-H_Q0ezjcBM9gCta=wVZyUKs+7WExwKRuJRdhssq9B8Bg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

>but I think that those numbers can be returned as large integers just like it was with 9.3 drivers or just like it is

I'm afraid it is not possible at jdbc driver level.
You need to change application code.

As far as I can see from your output, backend reports float8.
That means, we have just a "double" at the client side, and we have no
idea what string representation is "expected".

If you want a "epoch time", I would recommend using resultSet.getLong().
Additionally, you might want to cast the selected expression to int8,
so you do not mess with floating point numerics.

Is there a specific reason why you expect non-scientific output of a
_floating_ value out of .getString()?

Vladimir

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2015-10-15 20:47:34 Re: Release 1204 released
Previous Message Michał Niklas 2015-10-15 12:18:24 Change of format of returned flat value after prepareThreshold