Skip site navigation (1) Skip section navigation (2)

Re: Timestamp weirdness

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <oliver(at)opencloud(dot)com>
Cc: <emergency(dot)shower(at)gmail(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>,<tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Timestamp weirdness
Date: 2005-07-26 14:10:43
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
This explains why my suggestion would not work -- I was aware that
specifying a timezone to a TIMESTAMP WITHOUT TIME ZONE resulted in the
time zone being completely ignored -- I assumed that handling of the
value string for a timestampz within the protocol would follow the same
rules.  This also explains why it works correctly when people convert
the timestamp into a string with the desired time zone and insert that
as a literal in place of the ? within the PreparedStatement.
Thanks for the info.
I assume that the behavior of the server when receiving a timestampz
within the protocol couldn't be changed to match the handling of a
literal without breaking significant existing code.
>>> Oliver Jowett <oliver(at)opencloud(dot)com> 07/25/05 6:08 PM >>>

If the target type is actually timestamp (TIMESTAMP WITHOUT TIME ZONE),
the server converts the instant identified by the timestamptz value
using the server's TimeZone setting to get a local date/time, and stores
The string -> timestamp conversion
*completely ignores* the supplied timezone, just using the specified
date/time directly

pgsql-jdbc by date

Next:From: Peter.ZocheDate: 2005-07-26 14:17:19
Subject: Re: SQLException and error code
Previous:From: Oliver JowettDate: 2005-07-26 14:04:20
Subject: Re: SQLException and error code

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group