Re: Problem with java infinity mapping to postgres real column type

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Problem with java infinity mapping to postgres real column type
Дата
Msg-id 7489.1216217283@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Problem with java infinity mapping to postgres real column type  ("Johan Miller" <johanmiller@gmail.com>)
Ответы Re: Problem with java infinity mapping to postgres real column type
Список pgsql-jdbc
"Johan Miller" <johanmiller@gmail.com> writes:
> I have found that when trying to insert a Java Float.POSITIVE_INFINITY or
> its negative counterpart into a database column with data type real using a
> jdbc driver 8.1-406 or 8.2-504 postgres will throw an overflow error.
> Since both Java and Postgres real data type support infinity then this seems
> very strange.

It sounds like "infinity" is getting translated to "some large number"
rather than the correct "Infinity" or "-Infinity" symbol.  The latter
two should work on IEEE-compliant platforms, but you might want to check
manually:

regression=# select 'infinity'::float4;
  float4
----------
 Infinity
(1 row)

regression=# select '-infinity'::float4;
  float4
-----------
 -Infinity
(1 row)

            regards, tom lane

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: nalini
Дата:
Сообщение: Re: Transaction handling through java
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Problem with java infinity mapping to postgres real column type