Re: 7.3 -> 8.0.4 migration timestamp problem

From: Eliézer Madeira de Campos <eliezer(at)diuno(dot)com(dot)br>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: 7.3 -> 8.0.4 migration timestamp problem
Date: 2005-11-04 22:39:12
Message-ID: 54CC7CADE26E884EB2BCEC863F5C1F70F9D282@moscou.diuno.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

-----Original Message-----
From: Oliver Jowett [mailto:oliver(at)opencloud(dot)com]
Sent: sexta-feira, 4 de novembro de 2005 20:20
To: Eliézer Madeira de Campos
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] 7.3 -> 8.0.4 migration timestamp problem

Eliézer Madeira de Campos wrote:

>> The date stored in database is actually 1912-12-31 23:53:12.0 (however it should have stored 1913-01-01.
>>
>> I have already debugged the Postgres-8.0 (build 313) driver and it seems to send the correct date to database.

> What type is the target column you are inserting into?
Timestamp without timezone.

>> Timestamp ts = new Timestamp(c.getTimeInMillis());
>> pst = con.prepareStatement("select date_trunc('day', TIMESTAMP ?)");
>> pst.setObject(1, ts);

> Use "CAST (? AS TIMESTAMP)" instead of "TIMESTAMP ?".
Why should I, if "TIMESTAMP ?" works when I run the insert in psql (or via unprepared statement)?
That might be valid as a workaround, but it would cost me thousands changes in the application, so it's not really a solution to the problem.

Eliézer M de Campos

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2005-11-05 01:33:26 Re: 7.3 -> 8.0.4 migration timestamp problem
Previous Message Oliver Jowett 2005-11-04 22:20:03 Re: 7.3 -> 8.0.4 migration timestamp problem