Re: Bug : FAST_NUMBER_FAILED when getting NaN on BigDecimal - Mailing list pgsql-jdbc

From Kevin Grittner
Subject Re: Bug : FAST_NUMBER_FAILED when getting NaN on BigDecimal
Date
Msg-id 505700FA020000250004A461@gw.wicourts.gov
Whole thread Raw
In response to Re: Bug : FAST_NUMBER_FAILED when getting NaN on BigDecimal  (Craig Ringer <ringerc@ringerc.id.au>)
List pgsql-jdbc
Craig Ringer <ringerc@ringerc.id.au> wrote:
> On 09/12/2012 05:00 PM, DocSea - Patrice Delorme wrote:

>> Maybe a more explicit Exception like "numeric NaN values not
>> supported" and not "org.postgresql.util.PSQLException: Bad value
>> for type BigDecimal : NaN;" which is rather obscure
>
> Certainly some improvement to the message is warranted. I'm not
> sure I like the proposed one though. Maybe "BigDecimal cannot
> represent NaN, so the NUMERIC 'NaN' from PostgreSQL could not be
> returned." ?

For comparison, you can invoke the BigDecimal(double) constructor
with Double.NaN without any compile error, and at run time you get
this:

    java.lang.NumberFormatException: Infinite or NaN

How differently do we want to treat this than the all-Java parallel
situation?

-Kevin


pgsql-jdbc by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Change in Log Format and Prepared Statements
Next
From: Craig Ringer
Date:
Subject: Re: pgbouncer transaction patch?