Re: [HACKERS] Weird new time zone

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-hackers-win32(at)postgresql(dot)org
Subject: Re: [HACKERS] Weird new time zone
Date: 2004-07-10 23:53:06
Message-ID: 21807.1089503586@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32

I wrote:
> I was initially thinking that probing a large number of test times
> would be expensive, but on second thought I don't see that it would
> be a problem. On nearly all the entries in the TZ database, we'd
> reject on the first or second probe time anyway; only very near
> matches such as in Chris' example would need multiple checks.

I've committed changes that replace the original "spot check" approach
with consistently checking every week from 1970 to 2004. This is indeed
not much slower than before (the worst difference I saw was from 7 to 14
milliseconds required for identify_system_timezone to process the same
case, and I think some of that was measurement noise). This fixes Chris'
Australia/Perth problem at least.

It occurs to me that with a check this thorough, we might be able to
finesse the problem on Windows with the system returning very
nonstandard timezone abbreviations. That is, we might simply
"#ifndef WIN32" the matching of zone names in try_timezone().
However I do not know whether this would yield reasonable results for
all the zones supported by Windows. Does anyone want to try it?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-07-11 00:01:58 Re: Nested Transactions, Abort All
Previous Message Oliver Jowett 2004-07-10 23:40:14 Re: [BUGS] BUG #1118: Misleading Commit message

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Bruce Momjian 2004-07-11 00:58:00 Re: Re : Win32 binaries test / pg_dump problem
Previous Message Bill Moran 2004-07-10 19:44:38 Re: win32 port