Re: Bug : FAST_NUMBER_FAILED when getting NaN on BigDecimal

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Bug : FAST_NUMBER_FAILED when getting NaN on BigDecimal
Дата
Msg-id 505700FA020000250004A461@gw.wicourts.gov
обсуждение исходный текст
Ответ на Re: Bug : FAST_NUMBER_FAILED when getting NaN on BigDecimal  (Craig Ringer <ringerc@ringerc.id.au>)
Список 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 по дате отправления:

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Change in Log Format and Prepared Statements
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: pgbouncer transaction patch?