From: Christian Cryder <c.s.cryder@gmail.com>
To: List <pgsql-jdbc@postgresql.org>
Subject: Re: Timestamp Conversion Woes Redux
Date: Wed, 20 Jul 2005 10:09:33 -0600
Message-ID: <90876a9e05072009091f210d2b@mail.gmail.com> (raw)
In-Reply-To: <90876a9e05072008402337966@mail.gmail.com>
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>
<C7A5803D-232A-4B17-9546-9C7A4B95C704@fastcrypt.com>
<42DE42E5.6010206@opencloud.com>
<90876a9e05072008402337966@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: c.s.cryder@gmail.com
Subject: Re: Timestamp Conversion Woes Redux
In-Reply-To: <90876a9e05072009091f210d2b@mail.gmail.com>
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> <C7A5803D-232A-4B17-9546-9C7A4B95C704@fastcrypt.com> <42DE42E5.6010206@opencloud.com> <90876a9e05072008402337966@mail.gmail.com> <90876a9e05072009091f210d2b@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox