forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8ab6608
committed
Tweak our special-case logic for the IANA "Factory" timezone.
pg_timezone_names() tries to avoid showing the "Factory" zone inthe view, mainly because that has traditionally had a very long"abbreviation" such as "Local time zone must be set--see zic manual page",so that showing it messes up psql's formatting of the whole view.Since tzdb version 2016g, IANA instead uses the abbreviation "-00",which is sane enough that there's no reason to discriminate against it.On the other hand, it emerges that FreeBSD and possibly other packagersare so wedded to backwards compatibility that they hack the IANA datato keep the old spelling --- and not just that old spelling, but evenolder spellings that IANA used back in the stone age. This caused thefilter logic to fail to suppress "Factory" at all on such platforms,though the formatting problem is definitely real in that case.To solve both problems, get rid of the hard-wired assumption aboutexactly what Factory's abbreviation is, and instead reject abbreviationsexceeding 31 characters. This will allow Factory to appear in the viewif and only if it's using the modern abbreviation.In passing, simplify the code we add to zic.c to support "zic -P"to remove its now-obsolete hacks to not print the Factory zone'sabbreviation. Unlike pg_timezone_names(), there's no reason forthat code to support old/nonstandard timezone data.Since we generally prefer to keep timezone-related behavior thesame in all branches, and since this is arguably a bug fix,back-patch to all supported branches.Discussion:https://postgr.es/m/3961.1564086915@sss.pgh.pa.us1 parent3754113 commit8ab6608
2 files changed
+16
-23
lines changedLines changed: 8 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4826 | 4826 |
| |
4827 | 4827 |
| |
4828 | 4828 |
| |
4829 |
| - | |
4830 |
| - | |
4831 |
| - | |
4832 |
| - | |
4833 |
| - | |
4834 |
| - | |
4835 |
| - | |
| 4829 | + | |
| 4830 | + | |
| 4831 | + | |
| 4832 | + | |
| 4833 | + | |
| 4834 | + | |
| 4835 | + | |
4836 | 4836 |
| |
4837 |
| - | |
4838 |
| - | |
| 4837 | + | |
4839 | 4838 |
| |
4840 | 4839 |
| |
4841 | 4840 |
| |
|
Lines changed: 8 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2443 | 2443 |
| |
2444 | 2444 |
| |
2445 | 2445 |
| |
2446 |
| - | |
2447 |
| - | |
2448 |
| - | |
2449 |
| - | |
2450 |
| - | |
2451 |
| - | |
2452 |
| - | |
| 2446 | + | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
2453 | 2450 |
| |
2454 | 2451 |
| |
2455 | 2452 |
| |
| |||
2458 | 2455 |
| |
2459 | 2456 |
| |
2460 | 2457 |
| |
2461 |
| - | |
2462 |
| - | |
2463 |
| - | |
2464 |
| - | |
2465 |
| - | |
2466 |
| - | |
2467 |
| - | |
| 2458 | + | |
| 2459 | + | |
| 2460 | + | |
| 2461 | + | |
2468 | 2462 |
| |
2469 | 2463 |
| |
2470 | 2464 |
| |
|
0 commit comments
Comments
(0)