Re: Problems with infinity - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Problems with infinity
Date
Msg-id Pine.BSO.4.56.0501130835370.26@leary.csoft.net
Whole thread Raw
In response to Problems with infinity  (Oliver Siegmar <o.siegmar@vitrado.de>)
Responses Re: Problems with infinity
List pgsql-jdbc

On Thu, 13 Jan 2005, Oliver Siegmar wrote:

> I'm using PostgreSQL 7.4.6 with pg74.215.jdbc3.jar and have trouble with
> infinite timestamp values.
>
> Caused by: org.postgresql.util.PSQLException: Bad Timestamp Format at 0 in
> 9999-01-01

This is indeed a bug in the 7.4 drivers.

> Furthermore, in your TODO list I read "The conversion to/from datatypes
> supporting infinity is silly because Java doesn't have a similar concept.
> Throw an exception instead.".

Actually the fact that the 7.4 drivers don't even work and no one has ever
complained previously is a pretty strong endorsement of this todo item
(which has already been done in the 8.0 codebase.)

> That's really bad. I can't change the database content because several stored
> procedures are based on infinite timestamp values.
>

You may use getString() on the column and check for infinity yourself.
Using setString(x, "Infinity") will work with the 7.4 drivers, but not
8.0.  Perhaps we could make setObject(x, "Infinity", Types.TIMESTAMP)
accomodate this though...

Kris Jurka




pgsql-jdbc by date:

Previous
From: Oliver Siegmar
Date:
Subject: Problems with infinity
Next
From: Oliver Siegmar
Date:
Subject: Re: Problems with infinity