X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9274DD9A2D for ; Fri, 4 Nov 2005 18:41:32 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 19041-08 for ; Fri, 4 Nov 2005 22:41:29 +0000 (GMT) X-Greylist: delayed 04:02:59.150285 by SQLgrey- Received: from mail.diuno.com.br (unknown [200.175.102.226]) by svr1.postgresql.org (Postfix) with ESMTP id B296DD99A4 for ; Fri, 4 Nov 2005 18:41:29 -0400 (AST) X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Re: 7.3 -> 8.0.4 migration timestamp problem Date: Fri, 4 Nov 2005 20:39:12 -0200 Message-ID: <54CC7CADE26E884EB2BCEC863F5C1F70F9D282@moscou.diuno.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [JDBC] 7.3 -> 8.0.4 migration timestamp problem Thread-Index: AcXhjaJIU6usap9JT1CqONityrG78AAAt2FQ From: =?iso-8859-1?Q?Eli=E9zer_Madeira_de_Campos?= To: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[AWL=0.000] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/19 X-Sequence-Number: 14117 =20 -----Original Message----- From: Oliver Jowett [mailto:oliver@opencloud.com] Sent: sexta-feira, 4 de novembro de 2005 20:20 To: Eli=E9zer Madeira de Campos Cc: pgsql-jdbc@postgresql.org Subject: Re: [JDBC] 7.3 -> 8.0.4 migration timestamp problem Eli=E9zer 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. >> =20 >> I have already debugged the Postgres-8.0 (build 313) driver and = it seems to send the correct date to database. =20 > What type is the target column you are inserting into? Timestamp without timezone. >> Timestamp ts =3D new Timestamp(c.getTimeInMillis()); >> pst =3D 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=E9zer M de Campos