Re: UCT (Re: pgsql: Update time zone data files to tzdata release 2019a.)
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christoph Berg <myon@debian.org>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2019-06-11T20:41:39Z
Lists: pgsql-hackers
Christoph Berg <myon@debian.org> writes: > In the meantime I realized that I was only testing /etc/timezone > (which is a plain file with just the zone name), while not touching > /etc/localtime at all. In this environment, it's a symlink: > lrwxrwxrwx 1 root root 27 Mär 28 14:49 /etc/localtime -> /usr/share/zoneinfo/Etc/UTC > ... but the name still gets canonicalized to Etc/UCT or UCT. Now that I'm home again, I tried to replicate this behavior. I don't have Debian Buster installed, but I do have an up-to-date Stretch install, and I can't get it to do this. What I see is that 1. HEAD will follow the spelling appearing in /etc/localtime, if that's a symlink. It will not pay any attention to /etc/timezone --- but as far as I can tell, glibc doesn't either. (For instance, if I remove /etc/localtime, then date(1) starts reporting UTC, independently of what /etc/timezone might say.) 2. Pre-v12, or if we can't get a valid zone name out of /etc/localtime, the identify_system_timezone() search settles on "UCT" as being the shortest and alphabetically first of the various equivalent names for the zone. The only way I can get it to pick "Etc/UCT" is if that's what I put into /etc/localtime. (In which case I maintain that that's not a bug, or at least not our bug.) So I'm still mystified by Christoph's report, and am forced to suspect pilot error -- specifically, /etc/localtime not containing what he said. Anyway, moving on to the question of what should we do about this, I don't really have anything better to offer than back-patching 23bd3cec6. I'm fairly hesitant to do that given the small amount of testing it's gotten ... but given that it's been in the tree since September, maybe we can feel like we'd have noticed any really bad problems. I don't have any use for Andrew's suggestion of looking into zone1970.tab: in the first place I'm unconvinced that the tzdb guys intend that file to offer canonical zone names, and in the second place I doubt we can rely on the file to be present (it's not installed by zic itself), and in the third place it definitely won't fix this particular issue because it has no entries for UTC/UCT/GMT etc, only for geographical locations. Thoughts? regards, tom lane PS: As a side note, I do notice an interesting difference between the timezone database files as they appear on Debian versus what I see on RHEL or in a PG-generated timezone tree. Debian seems to use symlinks for multiple equivalent zones: $ ls -l /usr/share/zoneinfo/U?? -rw-r--r-- 1 root root 127 Mar 27 16:34 /usr/share/zoneinfo/UCT lrwxrwxrwx 1 root root 3 Mar 27 16:34 /usr/share/zoneinfo/UTC -> UCT $ ls -l /usr/share/zoneinfo/Etc/U?? lrwxrwxrwx 1 root root 6 Mar 27 16:34 /usr/share/zoneinfo/Etc/UCT -> ../UCT lrwxrwxrwx 1 root root 6 Mar 27 16:34 /usr/share/zoneinfo/Etc/UTC -> ../UCT but elsewhere these are hard links: $ ls -l /usr/share/zoneinfo/U?? -rw-r--r--. 8 root root 118 Mar 26 11:37 /usr/share/zoneinfo/UCT -rw-r--r--. 8 root root 118 Mar 26 11:37 /usr/share/zoneinfo/UTC $ ls -l /usr/share/zoneinfo/Etc/U?? -rw-r--r--. 8 root root 118 Mar 26 11:37 /usr/share/zoneinfo/Etc/UCT -rw-r--r--. 8 root root 118 Mar 26 11:37 /usr/share/zoneinfo/Etc/UTC However, identify_system_timezone() doesn't treat symlinks differently from regular files, so this doesn't explain anything about the problem at hand, AFAICS.
Commits
-
Tweak our special-case logic for the IANA "Factory" timezone.
- f6c7c64e9fc8 9.6.15 landed
- f227aecb9af7 9.5.19 landed
- e49132e633b5 9.4.24 landed
- d304313b071a 11.5 landed
- d095b2fe676a 12.0 landed
- 8ab66081ca49 13.0 landed
- 55862b2e9303 10.10 landed
-
Avoid choosing "localtime" or "posixrules" as TimeZone during initdb.
- 6c4ffab76320 9.4.24 landed
- 9ef8117420d4 9.5.19 landed
- 51b47471f0f6 9.6.15 landed
- ae9b91be79ea 10.10 landed
- 4459266bf0d3 11.5 landed
- e31dfe99c8c6 12.0 landed
- 3754113f3365 13.0 landed
-
Prefer timezone name "UTC" over alternative spellings.
- e3846a00c2f8 12.0 cited
-
Attempt to identify system timezone by reading /etc/localtime symlink.
- 995b4fe0b14f 11.4 landed
- 8de574aa8bf7 10.9 landed
- 77dc741a1727 9.5.18 landed
- 75b0f21e1b19 9.6.14 landed
- 37011bcb30a9 9.4.23 landed
-
Update time zone data files to tzdata release 2019a.
- f6307bacabf5 11.3 cited