X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CCAD052808 for ; Wed, 20 Jul 2005 13:10:17 -0300 (ADT) 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 08475-02 for ; Wed, 20 Jul 2005 16:10:08 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.196]) by svr1.postgresql.org (Postfix) with ESMTP id B0DB1529B9 for ; Wed, 20 Jul 2005 13:10:05 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id i21so1470312wra for ; Wed, 20 Jul 2005 09:10:05 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=FPmaLtF5V61nEvTLnSHoTQDDrPvzFoqU9PlP+e4gqCD/pOz5yPFW/YmXjRxZITN8MbvSisyhfhomNm1/N265n755XcovANNnfhci329QSpHBLsY9uOKRvL8rtU1lnb8flfl0hNMbcHzCG9iCM0DqEr3FPDGmYgEXASl+U1cC96g= Received: by 10.54.38.57 with SMTP id l57mr143189wrl; Wed, 20 Jul 2005 09:09:33 -0700 (PDT) Received: by 10.54.86.16 with HTTP; Wed, 20 Jul 2005 09:09:33 -0700 (PDT) Message-ID: <90876a9e05072009091f210d2b@mail.gmail.com> Date: Wed, 20 Jul 2005 10:09:33 -0600 From: Christian Cryder Reply-To: Christian Cryder To: List Subject: Re: Timestamp Conversion Woes Redux In-Reply-To: <90876a9e05072008402337966@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <90876a9e05071810503606d431@mail.gmail.com> <42DDABAE.7050009@opencloud.com> <15EA293E-6D5D-4FD2-B498-6546113822C1@fastcrypt.com> <42DDB0B0.1020006@opencloud.com> <468CE7D4-3BFC-48D8-BC94-3AA73950EBED@fastcrypt.com> <42DDBE3B.5040801@opencloud.com> <6E6559F0-401F-47E8-A756-245C5B0813A7@fastcrypt.com> <42DE42E5.6010206@opencloud.com> <90876a9e05072008402337966@mail.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.097 tagged_above=0 required=5 tests=AWL, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200507/180 X-Sequence-Number: 13328 One other comment - if it was me implementing this thing from scratch, here's how I'd be inclined to tackle it... a) I'd send the timestamp value across the wire as millis (the millis value won't change based on whether DST is turned on/off w/in the default zone on the client) - so reading/sending as millis would mean that the client wouldn't end up munging any dates unintentionally simply on the basis of DST (which is a problem no) b) I would interpret setTimestamp(i, ts, cal) as meaning "convert from current millis to millis in cal's timezone", and then send that new millis value across the wire c) I'd send the timestamp across the wire as UNKNOWN, and then allow the server to make the decision based on the column type - since the server knows what the column is defined as, it can easily decide how to interpret the millis value when figuring out how to actually persist it It seems to me this would handle all the problems we are having, while working within the API limitations. It doesn't seem like it would break any existing code (at least not anything that's not already broken). Of course, I have no idea whether any of this is feasible or not. But I think the root of our problems is tied to flattening timestamp objects via toString(), which then applies the calendar rendering, which then applies DST rules of the default timezone (again, whether you want them to or not). One final consideration - has anyone evaluated the performance implications of rendering/reconstituting timestamps to Strings vs. millis? It seems to me like there must be a lot more overhead associated with the String versions (looking up calendars, applying dst logic, etc) than with millis. Christian