Re: Bug : FAST_NUMBER_FAILED when getting NaN on BigDecimal

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "DocSea - Patrice Delorme" <pdelorme(at)docsea(dot)com>, "Craig Ringer" <ringerc(at)ringerc(dot)id(dot)au>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Bug : FAST_NUMBER_FAILED when getting NaN on BigDecimal
Date: 2012-09-17 15:52:42
Message-ID: 505700FA020000250004A461@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Craig Ringer <ringerc(at)ringerc(dot)id(dot)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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Craig Ringer 2012-09-19 05:09:14 Re: pgbouncer transaction patch?
Previous Message Craig Ringer 2012-09-17 11:54:25 Re: Change in Log Format and Prepared Statements