more timeofday() and "set time zone" weirdness

From: jason_priebe(at)yahoo(dot)com (Jason Priebe)
To: pgsql-general(at)postgresql(dot)org
Subject: more timeofday() and "set time zone" weirdness
Date: 2003-08-13 15:04:14
Message-ID: ff375b78.0308130704.27b8c30b@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I posted earlier with a very complex example. This simple one
gets to the point much faster. timeofday() seems to behave
inconsistently when the timezone is set with "GMT+X" notation.

foo=> select cast(timeofday() as timestamp with time zone); set time
zone 'GMT+4'; select cast(timeofday() as timestamp with time zone);
timeofday
-------------------------------
2003-08-13 11:01:26.502064-04
(1 row)

SET VARIABLE
timeofday
-------------------------------
2003-08-13 07:01:26.503328-04
(1 row)

I am currently 4 hours behind GMT. The first timestamp reflects
the correct time. After setting the time zone to "GMT+4", I get
a time value that is 4 hours too early. If I were to instead
use "America/New_York" for the time zone, I would not have this
problem. Unfortunately, I cannot use such notation under Cygwin.
BTW -- I am seeing this problem with version 7.2.3 under RH Linux
version 7.3.

Jason Priebe
jason_priebe(at)yahoo(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-08-13 15:25:33 Re: How to prevent vacuum and reindex from deadlocking.
Previous Message Teodor Sigaev 2003-08-13 14:59:54 Re: Tsearch2 lexeme position