Thread: "Conversion of interval failed" on PGInterval with 8.1dev-401.jdbc3.jar

"Conversion of interval failed" on PGInterval with 8.1dev-401.jdbc3.jar

From
"Jean-Pierre Pelletier"
Date:
Hi,
 
I've got PSQLException "Conversion of interval failed"
 throwned when trying to read an interval larger than
100 hours (101:12:00) into a PGInterval object.
It was running fine with the build 312 jdbc3 driver.
 
Here is the line of code which cause the error:
 
PGInterval interval = (PGInterval) resultset.getObject(1);
 
I am running PostgreSQL 8.1 beta2 on Windows 2000.
 
Thanks
Jean-Pierre Pelletier
e-djuster
 

Re: "Conversion of interval failed" on PGInterval with

From
Kris Jurka
Date:

On Thu, 29 Sep 2005, Jean-Pierre Pelletier wrote:

> I've got PSQLException "Conversion of interval failed"
> throwned when trying to read an interval larger than
> 100 hours (101:12:00) into a PGInterval object.
> It was running fine with the build 312 jdbc3 driver.
>

OK, this is because 8.1 has separated hours and days in an interval
definition, previously 100 hours turned into '4 days 4 hours', but in 8.1
it remains 100 hours.  I'll look at a fix...

Kris Jurka

Re: "Conversion of interval failed" on PGInterval with

From
Kris Jurka
Date:

On Thu, 29 Sep 2005, Kris Jurka wrote:

> On Thu, 29 Sep 2005, Jean-Pierre Pelletier wrote:
>
>> I've got PSQLException "Conversion of interval failed"
>> throwned when trying to read an interval larger than
>> 100 hours (101:12:00) into a PGInterval object.
>> It was running fine with the build 312 jdbc3 driver.
>>
>
> OK, this is because 8.1 has separated hours and days in an interval
> definition, previously 100 hours turned into '4 days 4 hours', but in 8.1 it
> remains 100 hours.  I'll look at a fix...
>

I've fixed this in cvs for the 8.1 branch.

Kris Jurka