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