Skip to content
Snippets Groups Projects
  1. Apr 17, 2017
  2. Feb 25, 2017
    • Tom Lane's avatar
      Remove useless duplicate inclusions of system header files. · 9e3755ec
      Tom Lane authored
      c.h #includes a number of core libc header files, such as <stdio.h>.
      There's no point in re-including these after having read postgres.h,
      postgres_fe.h, or c.h; so remove code that did so.
      
      While at it, also fix some places that were ignoring our standard pattern
      of "include postgres[_fe].h, then system header files, then other Postgres
      header files".  While there's not any great magic in doing it that way
      rather than system headers last, it's silly to have just a few files
      deviating from the general pattern.  (But I didn't attempt to enforce this
      globally, only in files I was touching anyway.)
      
      I'd be the first to say that this is mostly compulsive neatnik-ism,
      but over time it might save enough compile cycles to be useful.
      9e3755ec
  3. Jan 30, 2017
    • Tom Lane's avatar
      Update time zone data files to tzdata release 2016j. · 308d8682
      Tom Lane authored
      DST law changes in northern Cyprus (new zone Asia/Famagusta), Russia (new
      zone Europe/Saratov), Tonga, Antarctica/Casey.  Historical corrections for
      Asia/Aqtau, Asia/Atyrau, Asia/Gaza, Asia/Hebron, Italy, Malta.  Replace
      invented zone abbreviation "TOT" for Tonga with numeric UTC offset; but
      as in the past, we'll keep accepting "TOT" for input.
      308d8682
  4. Jan 03, 2017
  5. Dec 15, 2016
  6. Nov 06, 2016
    • Tom Lane's avatar
      More zic cleanup. · 32416b0f
      Tom Lane authored
      The workaround the IANA guys chose to get rid of the clang warning
      we'd silenced in commit 23ed2ba8 turns out not to satisfy Coverity.
      Go back to the previous solution, ie, remove the useless comparison
      to SIZE_MAX.  (In principle, there could be machines out there where
      it's not useless because ptrdiff_t is wider than size_t.  But the whole
      thing is pretty academic anyway, as we could never approach this limit
      for any sane estimate of the amount of data that zic will ever be asked
      to work with.)
      
      Also, s/lineno/lineno_t/g, because if we accept their decision to start
      using "lineno" as a typedef, it is going to have very unpleasant
      consequences in our next pgindent run.  Noted that while fooling with
      pltcl yesterday.
      32416b0f
  7. Nov 04, 2016
    • Tom Lane's avatar
      Sync our copy of the timezone library with IANA tzcode master. · 1f87181e
      Tom Lane authored
      This patch absorbs some unreleased fixes for symlink manipulation bugs
      introduced in tzcode 2016g.  Ordinarily I'd wait around for a released
      version, but in this case it seems like we could do with extra testing,
      in particular checking whether it works in EDB's VMware build environment.
      This corresponds to commit aec59156abbf8472ba201b6c7ca2592f9c10e077 in
      https://github.com/eggert/tz.
      
      Per a report from Sandeep Thakkar, building in an environment where hard
      links are not supported in the timezone data installation directory failed,
      because upstream code refactoring had broken the case of symlinking from an
      existing symlink.  Further experimentation also showed that the symlinks
      were sometimes made incorrectly, with too many or too few "../"'s in the
      symlink contents.
      
      This should get back-patched, but first let's see what the buildfarm
      makes of it.  I'm not too sure about the new dependency on linkat(2).
      
      Report: <CANFyU94_p6mqRQc2i26PFp5QAOQGB++AjGX=FO8LDpXw0GSTjw@mail.gmail.com>
      Discussion: http://mm.icann.org/pipermail/tz/2016-November/024431.html
      1f87181e
  8. Oct 26, 2016
    • Tom Lane's avatar
      Fix not-HAVE_SYMLINK code in zic.c. · 19b2094d
      Tom Lane authored
      I broke this in commit f3094920.  Apparently it's dead code anyway,
      at least as far as our buildfarm is concerned (and the upstream IANA
      code doesn't worry at all about symlink() not being present).
      But as long as the rest of our code is willing to guard against not
      having symlink(), this should too.  Noted while investigating a
      tangentially-related complaint from Sandeep Thakkar.
      
      Back-patch to keep branches in sync.
      19b2094d
  9. Oct 20, 2016
  10. Oct 19, 2016
    • Tom Lane's avatar
      Update time zone data files to tzdata release 2016g. · ecbac3e6
      Tom Lane authored
      DST law changes in Turkey.  Historical corrections for America/Los_Angeles,
      Europe/Kirov, Europe/Moscow, Europe/Samara, and Europe/Ulyanovsk.
      Rename Asia/Rangoon to Asia/Yangon, with a backward compatibility link.
      
      The IANA crew continue their campaign to replace invented time zone
      abbrevations with numeric GMT offsets.  This update changes numerous zones
      in Antarctica and the former Soviet Union, for instance Antarctica/Casey
      now reports "+08" not "AWST" in the pg_timezone_names view.  I kept these
      abbreviations in the tznames/ data files, however, so that we will still
      accept them for input.  (We may want to start trimming those files someday,
      but today is not that day.)
      
      An exception is that since IANA no longer claims that "AMT" is in use
      in Armenia for GMT+4, I replaced it in the Default file with GMT-4,
      corresponding to Amazon Time which is in use in South America.  It may be
      that that meaning is also invented and IANA will drop it in a future
      update; but for now, it seems silly to give pride of place to a meaning
      not traceable to IANA over one that is.
      ecbac3e6
  11. Sep 05, 2016
    • Tom Lane's avatar
      Add regression test coverage for non-default timezone abbreviation sets. · c7f68bea
      Tom Lane authored
      After further reflection about the mess cleaned up in commit 39b691f2,
      I decided the main bit of test coverage that was still missing was to
      check that the non-default abbreviation-set files we supply are usable.
      Add that.
      
      Back-patch to supported branches, just because it seems like a good
      idea to keep this all in sync.
      c7f68bea
    • Tom Lane's avatar
      Remove vestigial references to "zic" in favor of "IANA database". · da6ea70c
      Tom Lane authored
      Commit b2cbced9 instituted a policy of referring to the timezone database
      as the "IANA timezone database" in our user-facing documentation.
      Propagate that wording into a couple of places that were still using "zic"
      to refer to the database, which is definitely not right (zic is the
      compilation tool, not the data).
      
      Back-patch, not because this is very important in itself, but because
      we routinely cherry-pick updates to the tznames files and I don't want
      to risk future merge failures.
      da6ea70c
  12. Aug 29, 2016
  13. Aug 05, 2016
    • Tom Lane's avatar
      Update time zone data files to tzdata release 2016f. · a629330b
      Tom Lane authored
      DST law changes in Kemerovo and Novosibirsk.  Historical corrections for
      Azerbaijan, Belarus, and Morocco.  Asia/Novokuznetsk and Asia/Novosibirsk
      now use numeric time zone abbreviations instead of invented ones.  Zones
      for Antarctic bases and other locations that have been uninhabited for
      portions of the time span known to the tzdata database now report "-00"
      rather than "zzz" as the zone abbreviation for those time spans.
      
      Also, I decided to remove some of the timezone/data/ files that we don't
      use.  At one time that subdirectory was a complete copy of what IANA
      distributes in the tzdata tarballs, but that hasn't been true for a long
      time.  There seems no good reason to keep shipping those specific files
      but not others; they're just bloating our tarballs.
      a629330b
  14. Jul 07, 2016
    • Tom Lane's avatar
      Reduce stack space consumption in tzload(). · 62c8421e
      Tom Lane authored
      While syncing our timezone code with IANA's updates in commit 1c1a7cbd,
      I'd chosen not to adopt the code they conditionally compile under #ifdef
      ALL_STATE.  The main thing that that drives is that the space for gmtime
      and localtime timezone definitions isn't statically allocated, but is
      malloc'd on first use.  I reasoned we didn't need that logic: we don't have
      localtime() at all, and we always initialize TimeZone to GMT so we always
      need that one.  But there is one other thing ALL_STATE does, which is to
      make tzload() malloc its transient workspace instead of just declaring it
      as a local variable.  It turns out that that local variable occupies 78K.
      Even worse is that, at least for common US timezone settings, there's a
      recursive call to parse the "posixrules" zone name, making peak stack
      consumption to select a time zone upwards of 150K.  That's an uncomfortably
      large fraction of our STACK_DEPTH_SLOP safety margin, and could result in
      outright crashes if we try to reduce STACK_DEPTH_SLOP as has been discussed
      recently.  Furthermore, this means that the postmaster's peak stack
      consumption is several times that of a backend running typical queries
      (since, except on Windows, backends inherit the timezone GUC values and
      don't ever run this code themselves unless you do SET TIMEZONE).  That's
      completely backwards from a safety perspective.
      
      Hence, adopt the ALL_STATE rather than non-ALL_STATE variant of tzload(),
      while not changing the other code aspects that symbol controls.  The
      risk of an ENOMEM error from malloc() seems less than that of a SIGSEGV
      from stack overrun.
      
      This should probably get back-patched along with 1c1a7cbd and followon
      fixes, whenever we decide we have enough confidence in the updates to do
      that.
      62c8421e
  15. May 06, 2016
    • Tom Lane's avatar
      Update time zone data files to tzdata release 2016d. · 98f158e4
      Tom Lane authored
      DST law changes in Russia (Magadan, Tomsk regions) and Venezuela.
      Historical corrections for Russia.  There are new zone names Europe/Kirov
      and Asia/Tomsk reflecting the fact that these regions now have different
      time zone histories from adjacent regions.
      98f158e4
  16. Apr 02, 2016
    • Tom Lane's avatar
      Suppress compiler warning. · 45aae8e7
      Tom Lane authored
      Some buildfarm members are showing "comparison is always false due to
      limited range of data type" complaints on this test, so #ifdef it out
      on machines with 32-bit int.
      45aae8e7
  17. Mar 31, 2016
    • Tom Lane's avatar
      Another zic portability fix. · c202ecf9
      Tom Lane authored
      I should have remembered that we can't use INT64_MODIFIER with sscanf():
      configure chooses that to work with snprintf(), but it might be for our
      src/port/snprintf.c implementation and so not compatible with the
      platform's sscanf().  This appears to be the explanation for buildfarm
      member frogmouth's continuing unhappiness with the tzcode update.
      
      Fortunately, in all of the places where zic is attempting to read into
      an int64 variable, it's reading a year which certainly will fit just fine
      into an int.  So make it read into an int with %d, and then cast or copy
      as necessary.
      c202ecf9
  18. Mar 29, 2016
    • Tom Lane's avatar
      Protect zic's symlink() call with #ifdef HAVE_SYMLINK. · 534da379
      Tom Lane authored
      The IANA crew seem to think that symlink() exists everywhere nowadays,
      and they may well be right.  But we use #ifdef HAVE_SYMLINK elsewhere
      so for consistency we should do it here too.  Noted by Michael Paquier.
      534da379
    • Tom Lane's avatar
      Fix zic for Windows. · 6d257e73
      Tom Lane authored
      The new coding of dolink() is dependent on link() returning an on-point
      errno when it fails; but the quick-hack implementation of link() that
      we'd put in for Windows didn't bother with setting errno.  Fix that.
      
      Analysis and patch by Christian Ullrich.
      6d257e73
  19. Mar 28, 2016
    • Tom Lane's avatar
      Sync tzload() and tzparse() APIs with IANA release tzcode2016c. · 1f4e9da6
      Tom Lane authored
      This brings us a bit closer to matching upstream, but since it affects
      files outside src/timezone/, we might choose not to back-patch it.
      Hence keep it separate from the main update patch.
      1f4e9da6
    • Tom Lane's avatar
      Sync our copy of the timezone library with IANA release tzcode2016c. · 1c1a7cbd
      Tom Lane authored
      We hadn't done this in about six years, which proves to have been a mistake
      because there's been a lot of code churn upstream, making the merge rather
      painful.  But putting it off any further isn't going to lessen the pain,
      and there are at least two incompatible changes that we need to absorb
      before someone starts complaining that --with-system-tzdata doesn't work
      at all on their platform, or we get blindsided by a tzdata release that
      our out-of-date zic can't compile.  Last week's "time zone abbreviation
      differs from POSIX standard" mess was a wake-up call in that regard.
      
      This is a sufficiently large patch that I'm afraid to back-patch it
      immediately, though the foregoing considerations imply that we probably
      should do so eventually.  For the moment, just put it in HEAD so that
      it can get some testing.  Maybe we can wait till the end of the 9.6
      beta cycle before deeming it okay.
      1c1a7cbd
  20. Mar 26, 2016
    • Tom Lane's avatar
      Modernize zic's test for valid timezone abbreviations. · 221619ad
      Tom Lane authored
      We really need to sync all of our IANA-derived timezone code with upstream,
      but that's going to be a large patch and I certainly don't care to shove
      such a thing into stable branches immediately before a release.  As a
      stopgap, copy just the tzcode2016c logic that checks validity of timezone
      abbreviations.  This prevents getting multiple "time zone abbreviation
      differs from POSIX standard" bleats with tzdata 2014b and later.
      221619ad
    • Tom Lane's avatar
      Update time zone data files to tzdata release 2016c. · 676265eb
      Tom Lane authored
      DST law changes in Azerbaijan, Chile, Haiti, Palestine, and Russia (Altai,
      Astrakhan, Kirov, Sakhalin, Ulyanovsk regions).  Historical corrections
      for Lithuania, Moldova, Russia (Kaliningrad, Samara, Volgograd).
      
      As of 2015b, the keepers of the IANA timezone database started to use
      numeric time zone abbreviations (e.g., "+04") instead of inventing
      abbreviations not found in the wild like "ASTT".  This causes our rather
      old copy of zic to whine "warning: time zone abbreviation differs from
      POSIX standard" several times during "make install".  This warning is
      harmless according to the IANA folk, and I don't see any problems with
      these abbreviations in some simple tests; but it seems like now would be
      a good time to update our copy of the tzcode stuff.  I'll look into that
      soon.
      676265eb
  21. Feb 05, 2016
  22. Jan 02, 2016
  23. Oct 03, 2015
  24. May 16, 2015
  25. Jan 31, 2015
  26. Jan 06, 2015
  27. Dec 24, 2014
    • Tom Lane's avatar
      Add CST (China Standard Time) to our lists of timezone abbreviations. · 5b89473d
      Tom Lane authored
      For some reason this seems to have been missed when the lists in
      src/timezone/tznames/ were first constructed.  We can't put it in Default
      because of the conflict with US CST, but we should certainly list it among
      the alternative entries in Asia.txt.  (I checked for other oversights, but
      all the other abbreviations that are in current use according to the IANA
      files seem to be accounted for.)  Noted while responding to bug #12326.
      5b89473d
  28. Nov 17, 2014
  29. Oct 16, 2014
    • Tom Lane's avatar
      Support timezone abbreviations that sometimes change. · b2cbced9
      Tom Lane authored
      Up to now, PG has assumed that any given timezone abbreviation (such as
      "EDT") represents a constant GMT offset in the usage of any particular
      region; we had a way to configure what that offset was, but not for it
      to be changeable over time.  But, as with most things horological, this
      view of the world is too simplistic: there are numerous regions that have
      at one time or another switched to a different GMT offset but kept using
      the same timezone abbreviation.  Almost the entire Russian Federation did
      that a few years ago, and later this month they're going to do it again.
      And there are similar examples all over the world.
      
      To cope with this, invent the notion of a "dynamic timezone abbreviation",
      which is one that is referenced to a particular underlying timezone
      (as defined in the IANA timezone database) and means whatever it currently
      means in that zone.  For zones that use or have used daylight-savings time,
      the standard and DST abbreviations continue to have the property that you
      can specify standard or DST time and get that time offset whether or not
      DST was theoretically in effect at the time.  However, the abbreviations
      mean what they meant at the time in question (or most recently before that
      time) rather than being absolutely fixed.
      
      The standard abbreviation-list files have been changed to use this behavior
      for abbreviations that have actually varied in meaning since 1970.  The
      old simple-numeric definitions are kept for abbreviations that have not
      changed, since they are a bit faster to resolve.
      
      While this is clearly a new feature, it seems necessary to back-patch it
      into all active branches, because otherwise use of Russian zone
      abbreviations is going to become even more problematic than it already was.
      This change supersedes the changes in commit 513d06de et al to modify the
      fixed meanings of the Russian abbreviations; since we've not shipped that
      yet, this will avoid an undesirably incompatible (not to mention incorrect)
      change in behavior for timestamps between 2011 and 2014.
      
      This patch makes some cosmetic changes in ecpglib to keep its usage of
      datetime lookup tables as similar as possible to the backend code, but
      doesn't do anything about the increasingly obsolete set of timezone
      abbreviation definitions that are hard-wired into ecpglib.  Whatever we
      do about that will likely not be appropriate material for back-patching.
      Also, a potential free() of a garbage pointer after an out-of-memory
      failure in ecpglib has been fixed.
      
      This patch also fixes pre-existing bugs in DetermineTimeZoneOffset() that
      caused it to produce unexpected results near a timezone transition, if
      both the "before" and "after" states are marked as standard time.  We'd
      only ever thought about or tested transitions between standard and DST
      time, but that's not what's happening when a zone simply redefines their
      base GMT offset.
      
      In passing, update the SGML documentation to refer to the Olson/zoneinfo/
      zic timezone database as the "IANA" database, since it's now being
      maintained under the auspices of IANA.
      b2cbced9
  30. Oct 04, 2014
    • Tom Lane's avatar
      Update time zone data files to tzdata release 2014h. · 513d06de
      Tom Lane authored
      Most zones in the Russian Federation are subtracting one or two hours
      as of 2014-10-26.  Update the meanings of the abbreviations IRKT, KRAT,
      MAGT, MSK, NOVT, OMST, SAKT, VLAT, YAKT, YEKT to match.
      
      The IANA timezone database has adopted abbreviations of the form AxST/AxDT
      for all Australian time zones, reflecting what they believe to be current
      majority practice Down Under.  These names do not conflict with usage
      elsewhere (other than ACST for Acre Summer Time, which has been in disuse
      since 1994).  Accordingly, adopt these names into our "Default" timezone
      abbreviation set.  The "Australia" abbreviation set now contains only
      CST,EAST,EST,SAST,SAT,WST, all of which are thought to be mostly historical
      usage.  Note that SAST has also been changed to be South Africa Standard
      Time in the "Default" abbreviation set.
      
      Add zone abbreviations SRET (Asia/Srednekolymsk) and XJT (Asia/Urumqi),
      and use WSST/WSDT for western Samoa.
      
      Also a DST law change in the Turks & Caicos Islands (America/Grand_Turk),
      and numerous corrections for historical time zone data.
      513d06de
  31. Oct 03, 2014
    • Tom Lane's avatar
      Update time zone abbreviations lists. · 4f499eee
      Tom Lane authored
      This updates known_abbrevs.txt to be what it should have been already,
      were my -P patch not broken; and updates some tznames/ entries that
      missed getting any love in previous timezone data updates because zic
      failed to flag the change of abbreviation.
      
      The non-cosmetic updates:
      
      * Remove references to "ADT" as "Arabia Daylight Time", an abbreviation
      that's been out of use since 2007; therefore, claiming there is a conflict
      with "Atlantic Daylight Time" doesn't seem especially helpful.  (We have
      left obsolete entries in the files when they didn't conflict with anything,
      but that seems like a different situation.)
      
      * Fix entirely incorrect GMT offsets for CKT (Cook Islands), FJT, FJST
      (Fiji); we didn't even have them on the proper side of the date line.
      (Seems to have been aboriginal errors in our tznames data; there's no
      evidence anything actually changed recently.)
      
      * FKST (Falkland Islands Summer Time) is now used all year round, so
      don't mark it as a DST abbreviation.
      
      * Update SAKT (Sakhalin) to mean GMT+11 not GMT+10.
      
      In cosmetic changes, I fixed a bunch of wrong (or at least obsolete)
      claims about abbreviations not being present in the zic files, and
      tried to be consistent about how obsolete abbreviations are labeled.
      
      Note the underlying timezone/data files are still at release 2014e;
      this is just trying to get us in sync with what those files actually
      say before we go to the next update.
      4f499eee
    • Tom Lane's avatar
      Fix bogus logic for zic -P option. · 59685704
      Tom Lane authored
      The quick hack I added to zic to dump out currently-in-use timezone
      abbreviations turns out to have a nasty bug: within each zone, it was
      printing the last "struct ttinfo" to be *defined*, not necessarily the
      last one in use.  This was mainly a problem in zones that had changed the
      meaning of their zone abbreviation (to another GMT offset value) and later
      changed it back.
      
      As a result of this error, we'd missed out updating the tznames/ files
      for some jurisdictions that have changed their zone abbreviations since
      the tznames/ files were originally created.  I'll address the missing data
      updates in a separate commit.
      59685704
Loading