Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id D518964FFC8 for ; Tue, 8 Jul 2008 04:28:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 15937-03 for ; Tue, 8 Jul 2008 04:28:16 -0300 (ADT) X-Greylist: delayed 00:07:21.502638 by SQLgrey-1.7.6 Received: from www01.kensystem.com (www01.kensystem.com [72.19.170.120]) by postgresql.org (Postfix) with ESMTP id BBDC864FFC4 for ; Tue, 8 Jul 2008 04:28:18 -0300 (ADT) Received: from 192.168.0.3 by www01.kensystem.com (SMTPD); id s20080708072046.236155; Tue, 08 Jul 2008 07:20:46 Message-ID: <4873154E.6020808@kensystem.com> Date: Tue, 08 Jul 2008 01:20:46 -0600 From: Ken Johanson User-Agent: Thunderbird 1.5.0.14 (Windows/20071210) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Timestamp without Timezone and differing client / server tzs Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200807/9 X-Sequence-Number: 18794 Hi all ,first let me describe the set up: Server: Postgresql 8.3.x Server's postgresql.conf:timezone = UTC Server's OS (Linux tz): /etc/localtime -> /usr/share/zoneinfo/UTC Client JDBC driver: PostgreSQL 8.3devel JDBC3g with SSL (build 602) Client/JVM TZ : America/Denver Now, execute query: rs = st.exceuteQuery("SELECT NOW()");//understood to be a with-tz type rs.next(); out.println(rs.getString(1)); --> 2008-07-08 07:09:59.284012+00 (expected, denver +0700) out.println(rs.getTimestamp(1)); --> 2008-07-08 01:09:59.284012 (expected, implicit Denver time) Now do a DML via prepared statement into a Timestamp without Timezone. ps.setTimestamp(new Timestamp(System.currentTimeMillis())); and select it: out.println(rs.getString(1)); --> 2008-07-08 14:09:59.284012+00 (un-expected??) out.println(rs.getTimestamp(1)); --> 2008-07-08 07:09:59.284012 (un-expected??) Question: with ts without tz storage, should not a timestamp be normalized to the servers implicit TZ (UTC in this case), since that is set in the config's client-tz? Also, is it possible/not to set the preferred TZ as a URL param to the driver? This would be a safe option (not break apps), I believe. It allows the string translation without tz to match the server's implicit (zone-less string) tz. Thanks, Ken