pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Cramer <pg@fastcrypt.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kris Jurka <books@ejurka.com>
Cc: Christian Cryder <c.s.cryder@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Timestamp Conversion Woes Redux
Date: Wed, 20 Jul 2005 21:37:32 -0400
Message-ID: <4F75AA15-79CE-4F5A-90C9-F018FC5A4C3F@fastcrypt.com> (raw)
In-Reply-To: <42DEF5BE.1080109@opencloud.com>
References: <90876a9e05071810503606d431@mail.gmail.com>
	<16335.1121714809@sss.pgh.pa.us>
	<10C90079-DD0A-43D7-9389-7486803F0AB1@fastcrypt.com>
	<42DC37AC.5030704@opencloud.com>
	<C36F2D5F-093E-489C-8D6F-A67B746EA6C8@fastcrypt.com>
	<42DCF0C9.4030501@opencloud.com>
	<23396.1121781259@sss.pgh.pa.us>
	<392278AB-987F-40CF-B59D-DDF53B9A4ACF@fastcrypt.com>
	<Pine.BSO.4.56.0507191100110.68@leary.csoft.net>
	<90876a9e050719093261c52c64@mail.gmail.com>
	<Pine.BSO.4.56.0507200109220.31980@leary.csoft.net>
	<42DDF238.8090601@opencloud.com>
	<Pine.BSO.4.56.0507201125190.5339@leary.csoft.net>
	<42DEDB5A.9000803@opencloud.com>
	<26535.1121903232@sss.pgh.pa.us>
	<42DEEA63.6090507@opencloud.com>
	<26982.1121906793@sss.pgh.pa.us>
	<42DEF5BE.1080109@opencloud.com>


On 20-Jul-05, at 9:09 PM, Oliver Jowett wrote:

> Tom Lane wrote:
>
>> Oliver Jowett <oliver@opencloud.com> writes:
>>
>>
>>> That's correct. A Timestamp is essentially a wrapper around
>>> milliseconds-since-epoch.
>>>
>>
>> OK --- that is also our interpretation of TIMESTAMP WITH TIME ZONE
>> (at the moment anyway --- there's some agitation for putting an
>> explicit zone identifier in too, because it looks like the SQL spec
>> requires that).
Reading the JDBC Tutorial suggests that this information would be  
used when
retrieving the timestamp.
>>
>
> Ah ok, this is where some of my confusion is coming from -- I assumed
> that WITH TIME ZONE actually stored the timezone you provided and  
> would
> preserve it on output. Guess I should test these things before  
> wading in!
>
>
>>> The thing is that there are two distinct variants of setTimestamp():
>>>
>>
>>
>>
>>> (1) setTimestamp(index, timestamp)
>>> (2) setTimestamp(index, timestamp, calendar)
>>>
>>
>>
>>> (2) obviously maps to timestamp-with-zone.
>>>
>>
>> Hm, that's not obvious to me at all.  If the timestamp is supposed  
>> to be
>> unconditional absolute time, then the only sensible interpretation  
>> of (1)
>> is that you're setting a timestamptz, and (2) would presumably  
>> produce
>> a timestamp-without-tz value corresponding to the local time  
>> readout of
>> the Calendar.
>>
>
> I was coming at it from the representations of the values:
>
>   '2005-01-01 15:00:00' is a timestamp representation
>   '2005-01-01 15:00:00+1300' is a timestamptz representation
>
> We don't have a timezone offset to send in case (1) so it "must" be a
> timestamp. But I can see where your interpretation comes from  
> though --
> if the Timestamp is defined to be milliseconds-since-epoch we can
> identify the instant without needing a separate timezone offset.
>
> Reviewing it all I'm leaning towards JDBC's idea of TIMESTAMP being
> timestamp-without-timezone; the driver is meant to convert the
> absolute-instant of the Timestamp to a particular date/time using a
> specified (or default) timezone. That interpretation would make  
> some of
> the setTimestamp() javadoc more comprehensible.
Well, there is documentation that suggests both are supported;  
however apparently
not simultaneously.
>
> This would also explain why Oracle apparently has a separate extension
> setTimestamptz() method.
>
> Think I'm going to give up on this now though..
>
> -O
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo@postgresql.org so that  
> your
>        message can get through to the mailing list cleanly
>
>




view thread (92+ messages)  latest in thread

Message-ID: <4F75AA15-79CE-4F5A-90C9-F018FC5A4C3F@fastcrypt.com>
Permalink:  ../4F75AA15-79CE-4F5A-90C9-F018FC5A4C3F@fastcrypt.com/
Also on:    postgresql.org/message-id/4F75AA15-79CE-4F5A-90C9-F018FC5A4C3F@fastcrypt.com

 · 

reply

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: pg@fastcrypt.com, oliver@opencloud.com, tgl@sss.pgh.pa.us, books@ejurka.com, c.s.cryder@gmail.com
  Subject: Re: Timestamp Conversion Woes Redux
  In-Reply-To: <4F75AA15-79CE-4F5A-90C9-F018FC5A4C3F@fastcrypt.com>
  References: <90876a9e05071810503606d431@mail.gmail.com> <16335.1121714809@sss.pgh.pa.us> <10C90079-DD0A-43D7-9389-7486803F0AB1@fastcrypt.com> <42DC37AC.5030704@opencloud.com> <C36F2D5F-093E-489C-8D6F-A67B746EA6C8@fastcrypt.com> <42DCF0C9.4030501@opencloud.com> <23396.1121781259@sss.pgh.pa.us> <392278AB-987F-40CF-B59D-DDF53B9A4ACF@fastcrypt.com> <Pine.BSO.4.56.0507191100110.68@leary.csoft.net> <90876a9e050719093261c52c64@mail.gmail.com> <Pine.BSO.4.56.0507200109220.31980@leary.csoft.net> <42DDF238.8090601@opencloud.com> <Pine.BSO.4.56.0507201125190.5339@leary.csoft.net> <42DEDB5A.9000803@opencloud.com> <26535.1121903232@sss.pgh.pa.us> <42DEEA63.6090507@opencloud.com> <26982.1121906793@sss.pgh.pa.us> <42DEF5BE.1080109@opencloud.com> <4F75AA15-79CE-4F5A-90C9-F018FC5A4C3F@fastcrypt.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