Re: [pgsql-hackers-win32] Weird new time zone - Mailing list pgsql-hackers

From Oliver Jowett
Subject Re: [pgsql-hackers-win32] Weird new time zone
Date
Msg-id 40FF9DD3.1060004@opencloud.com
Whole thread Raw
In response to Re: [pgsql-hackers-win32] Weird new time zone  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: [pgsql-hackers-win32] Weird new time zone  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Oliver Jowett wrote:

> The only timezones that get positive scores during startup are:
> 
> DEBUG:  TZ "Antarctica/McMurdo" gets max score 2080
> DEBUG:  TZ "Antarctica/South_Pole" gets max score 2080
> DEBUG:  TZ "Pacific/Auckland" gets max score 2080
> DEBUG:  TZ "NZ" gets max score 2080
> 
> Either of "NZ" or "Pacific/Auckland" would be correct.

Looking in the timezone data files, it appears that those two Antarctica 
timezones are identical to the NZ ones back to 1956. The CVS code only 
scans back to 1964.

Increasing MAX_TEST_TIMES to scan back 50 years produces this:

> DEBUG:  TZ "Antarctica/McMurdo" scores 2534: at -442152000 1955-12-28 12:00:00 std versus 1955-12-29 00:00:00 std
> DEBUG:  TZ "Antarctica/South_Pole" scores 2534: at -442152000 1955-12-28 12:00:00 std versus 1955-12-29 00:00:00 std
> DEBUG:  TZ "Pacific/Auckland" gets max score 2600
> DEBUG:  TZ "NZ" gets max score 2600

and it picks Pacific/Auckland.

Also I'm a bit nervous about that hardcoded 2004 start date for the scan 
in pgtz.c -- that will presumably break if the timezone data files are 
updated for post-2004 changes without a corresponding change to the scan 
code. Would it make sense to scan backwards from the current system time 
to a predetermined year?

-O


pgsql-hackers by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: [pgsql-hackers-win32] Weird new time zone
Next
From: "Zeugswetter Andreas SB SD"
Date:
Subject: Re: [pgsql-hackers-win32] Weird new time zone