On 7/25/05, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> The difficulty with both 2 and 3 is that the driver has no very good way
> of knowing whether it's writing to a timestamp with tz or one without.
> We can know the parameter datatype we send, but if that gets converted
> to the other type within the server, you're going to get burnt.
If I TIMESTAMP WITH TIME ZONE is implemented on the server as a
(timestamp, time zone)-pair, the server should be able to cast
TIMESTAMP WITH TIME ZONE correctly to TIMESTAMP WITHOUT TIME ZONE as
described in the SQL standard:
From TIMESTAMP WITH TIME ZONE to TIMESTAMP WITHOUT TIME ZONE
TargetValue = SourceValue.UTC + SourceValue.TimeZone
This cast is something like a conversion from a instance in time to a
local time representation.
In this case I would propose to send (if possible) timestamp and time
zone to the server, no matter if we'll write a TIMESTAMP WITH TIME
ZONE or a TIMESTAMP WITHOUT TIME ZONE value. We could have some hope
to get correct results then.
In response to
pgsql-jdbc by date
|Next:||From: email@example.com||Date: 2005-07-25 22:51:58|
|Subject: Re: Timestamp Summary|
|Previous:||From: Dennis Gesker||Date: 2005-07-25 21:18:55|
|Subject: Re: JdbcRowSet Problem|