Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id E946B650498 for ; Wed, 16 Jul 2008 11:28:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 41445-04-6 for ; Wed, 16 Jul 2008 11:28:17 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 6D0456502AA for ; Wed, 16 Jul 2008 11:08:08 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m6GE837t007490; Wed, 16 Jul 2008 10:08:03 -0400 (EDT) To: "Johan Miller" cc: pgsql-jdbc@postgresql.org Subject: Re: Problem with java infinity mapping to postgres real column type In-reply-to: <3713c3aa0807142254p72e8416dsd8c18a5ebf101212@mail.gmail.com> References: <3713c3aa0807142254p72e8416dsd8c18a5ebf101212@mail.gmail.com> Comments: In-reply-to "Johan Miller" message dated "Tue, 15 Jul 2008 08:54:41 +0300" Date: Wed, 16 Jul 2008 10:08:03 -0400 Message-ID: <7489.1216217283@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200807/40 X-Sequence-Number: 18825 "Johan Miller" 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