BUG #1073: JDBC "time with time zone" - Mailing list pgsql-bugs

From PostgreSQL Bugs List
Subject BUG #1073: JDBC "time with time zone"
Date
Msg-id 20040205123931.39D1BCF4D6B@www.postgresql.com
Whole thread Raw
Responses Re: BUG #1073: JDBC "time with time zone"  (Kris Jurka <books@ejurka.com>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      1073
Logged by:          Bob Messenger

Email address:      bob@cassiancapital.com

PostgreSQL version: 7.5 Dev

Operating system:   Linux

Description:        JDBC "time with time zone"

Details:

create table a(b time with time zone);

insert into a values ('00:00:00');

import java.sql.*;

public class JDBC
{
    public JDBC()
    throws Exception
    {
    Class.forName("org.postgresql.Driver");
    DriverManager.setLogStream(System.out);
    Connection db =
DriverManager.getConnection("jdbc:postgresql://blah/blah?loglevel=3",
"postgres", null);

    Statement st = db.createStatement();
    ResultSet rs = st.executeQuery("SELECT b FROM a");
    while (rs.next())
    {
        System.out.println(rs.getString(1));
        System.out.println(rs.getTimestamp(1));
    }
    rs.close();
    st.close();
    db.close();
    }

    public final static void main(String args[])
    throws Exception
    {
    new JDBC();
    }
}

getConnection returning
driver[className=org.postgresql.Driver,org.postgresql.Driver@16f0472]
00:00:00+00
Exception in thread "main" org.postgresql.util.PSQLException: Bad Timestamp
Format at 2 in 00:00:00+00
org.postgresql.jdbc1.AbstractJdbc1ResultSet.toTimestamp(AbstractJdbc1Result
        at Set.java:1183)
org.postgresql.jdbc1.AbstractJdbc1ResultSet.getTimestamp(AbstractJdbc1Resul
        at tSet.java:376)
        at JDBC.<init>(JDBC.java:17)
        at JDBC.main(JDBC.java:27)

pgsql-bugs by date:

Previous
From: Wilhelm Pakulla
Date:
Subject: Passing composite type to function fails...
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: Returned due to virus; was:Status