pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Johan Miller <johanmiller@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Problem with java infinity mapping to postgres real column type
Date: Wed, 16 Jul 2008 10:08:03 -0400
Message-ID: <7489.1216217283@sss.pgh.pa.us> (raw)
In-Reply-To: <3713c3aa0807142254p72e8416dsd8c18a5ebf101212@mail.gmail.com>
References: <3713c3aa0807142254p72e8416dsd8c18a5ebf101212@mail.gmail.com>

"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



view thread (7+ messages)  latest in thread

Message-ID: <7489.1216217283@sss.pgh.pa.us>
Permalink:  ../7489.1216217283@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7489.1216217283@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, johanmiller@gmail.com
  Subject: Re: Problem with java infinity mapping to postgres real column type
  In-Reply-To: <7489.1216217283@sss.pgh.pa.us>
  References: <3713c3aa0807142254p72e8416dsd8c18a5ebf101212@mail.gmail.com> <7489.1216217283@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox