Re: Weird new time zone - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Weird new time zone
Date
Msg-id 21807.1089503586@sss.pgh.pa.us
Whole thread Raw
In response to Re: Weird new time zone  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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

pgsql-hackers by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: [BUGS] BUG #1118: Misleading Commit message
Next
From: Bruce Momjian
Date:
Subject: Re: Nested Transactions, Abort All