Skip site navigation (1) Skip section navigation (2)

Re: Bug : FAST_NUMBER_FAILED when getting NaN on BigDecimal

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "David Johnston *EXTERN*" <polobo(at)yahoo(dot)com>,"Florent Guillaume" <fg(at)nuxeo(dot)com>,"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: "DocSea - Patrice Delorme" <pdelorme(at)docsea(dot)com>,<pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Bug : FAST_NUMBER_FAILED when getting NaN on BigDecimal
Date: 2012-09-12 14:48:12
Message-ID: D960CB61B694CF459DCFB4B0128514C2086259D3@exadv11.host.magwien.gv.at (view raw or flat)
Thread:
Lists: pgsql-jdbc
David Johnston wrote:
>>>> It is impossible to fetch data when numeric value in database is NaN

>>> How do you expect what you read to be represented in Java?

>> java.lang.Double.NaN I guess.

> If the driver returns NULL is these situations it could still maintain internally
> whether the NULL is the result of a conversion of INF/-INF/NaN or whether the NULL was in the data
> itself.  The driver could expose a "isNaN(), isPosInf(), and isNegInf() methods that the user could
> query upon seeing a NULL BigDecimal so that it knows the "meaning" of the NULL.  Backward
> compatibility only requires that the BigDecimal is still returned, new features can be added.

I don't think that's a good idea.

Apart from the fact that a null pointer isn't a good representation
for an out-of-bounds value, that would change the behaviour and might
break applications that expect the current behaviour.

I think it is OK to throw an exception if a value cannot be represented,
but it should be a meaningful message.

Yours,
Laurenz Albe

In response to

Responses

pgsql-jdbc by date

Next:From: David JohnstonDate: 2012-09-12 14:52:22
Subject: Re: Bug : FAST_NUMBER_FAILED when getting NaN on BigDecimal
Previous:From: David JohnstonDate: 2012-09-12 14:15:24
Subject: Re: Bug : FAST_NUMBER_FAILED when getting NaN on BigDecimal

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group