Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id AB13F650105 for ; Wed, 9 Jul 2008 04:29:28 -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 11501-01 for ; Wed, 9 Jul 2008 04:29:23 -0300 (ADT) X-Greylist: delayed 00:05:10.160992 by SQLgrey-1.7.6 Received: from rs44.luxsci.com (rs44.luxsci.com [64.49.254.134]) by postgresql.org (Postfix) with ESMTP id D9A436500EE for ; Wed, 9 Jul 2008 04:29:24 -0300 (ADT) Received: from rs48.luxsci.com (rs48.luxsci.com [65.61.166.92]) by rs44.luxsci.com (8.13.1/8.13.7) with ESMTP id m697O8m3028703 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 9 Jul 2008 02:24:09 -0500 Received: from rs48.luxsci.com (localhost [127.0.0.1]) by rs48.luxsci.com (8.13.1/8.13.7) with ESMTP id m697O8M7016197; Wed, 9 Jul 2008 02:24:08 -0500 Received: (from root@localhost) by rs48.luxsci.com (8.13.1/8.13.7/Submit) id m697O3OX016137; Wed, 9 Jul 2008 07:24:03 GMT Received: (from pchaubey@vertex.co.in) by Lux Scientiae SMTP Processor; Wed, 09 Jul 2008 07:24:02 +0000 Received: from [192.168.3.6] (121.241.234.2.static-pune.vsnl.net.in [121.241.234.2] (may be forged)) (user=pchaubey@vertex.co.in mech=PLAIN bits=2) by rs48.luxsci.com (8.13.1/8.13.7) with ESMTP id m697NKMq015332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 9 Jul 2008 02:23:23 -0500 Message-ID: <48746759.5080507@vertex.co.in> Date: Wed, 09 Jul 2008 12:53:05 +0530 From: Pushker Chaubey User-Agent: Thunderbird 1.5.0.14 (Windows/20071210) MIME-Version: 1.0 To: Ken Johanson CC: pgsql-jdbc@postgresql.org Subject: Re: Timestamp without Timezone and differing client / server tzs References: <4873154E.6020808@kensystem.com> <4873201F.1000700@opencloud.com> <487439D8.2050508@kensystem.com> <48743B53.4000002@opencloud.com> <48743F0C.6020504@kensystem.com> <4874419A.6030705@opencloud.com> <48744BE0.1010304@kensystem.com> In-Reply-To: <48744BE0.1010304@kensystem.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Comment: Lux Scientiae SMTP Processor Message ID - 1215588243-2639512.45290244 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200807/22 X-Sequence-Number: 18807 Ken Johanson wrote: > The servers and their schema (use-of ts w/o tz are not under my=20 > control; adding with-timezone would likely break apps that transmit=20 > date values with offset already normalized). Just wondering, other apps using same database must also be facing the=20 same problem as you are if they operate across various timezones. Since all the applications are sharing the same timestamp(without TZ)=20 column they all should follow the same protocol to update and read=20 values for this shared timestamp(without TZ) column. We had a similar situation where the schema (having a timestamp without=20 timezone column ) was not under our control and we had clients across=20 various timezone who accessed the database. If one client with timezone TZ1 updated the value, the other client with=20 timezone TZ2 did not read the correct value. To get around that we agreed on a reference timezone (GMT) so that=20 stored timestamp value would be as per GMT timezone. While updating the timestamp values first we had to manipulate it to a=20 value as it would be on a jvm with GMT timezone. And after reading it=20 from any client on any timezone we were doing the reverse manupulation.=20 Since we knew that read timestamp value is as per GMT time zone, we=20 could manipulate it to as per clients' time zone. And this protocol was followed by all the client applications. But whenever I have control over schema I prefer storing LONG values=20 directly (dates converted to millis) to using any database specific=20 timestamp implementation. This keeps my code easily adaptable to various=20 databases as I do not depend on Database behavior for dealing with=20 timestamp objects. Regards, Pushker Chaubey =0D The information contained in this electronic message and any attachments to= this message are intended for the exclusive use of the addressee(s) and ma= y contain proprietary, confidential or privileged information. If you are n= ot the intended recipient, you should not disseminate, distribute or copy t= his e-mail. Please notify the sender immediately and destroy the original m= essage all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient shoul= d check this email and any attachments for the presence of viruses. The com= pany accepts no liability for any damage caused by any virus transmitted by= this email. Please do not print this email unless it is absolutely necessary.=