summaryrefslogtreecommitdiff
path: root/src/timezone
Commit message (Collapse)AuthorAgeFilesLines
* Update time zone data files to tzdata release 2014a.Tom Lane2014-03-155-38/+78
| | | | DST law changes in Fiji, Turkey; historical changes in Israel, Ukraine.
* C comments: remove odd blank lines after #ifdef WIN32 linesBruce Momjian2014-03-131-1/+0
|
* Prevent potential overruns of fixed-size buffers.Tom Lane2014-02-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Coverity identified a number of places in which it couldn't prove that a string being copied into a fixed-size buffer would fit. We believe that most, perhaps all of these are in fact safe, or are copying data that is coming from a trusted source so that any overrun is not really a security issue. Nonetheless it seems prudent to forestall any risk by using strlcpy() and similar functions. Fixes by Peter Eisentraut and Jozef Mlich based on Coverity reports. In addition, fix a potential null-pointer-dereference crash in contrib/chkpass. The crypt(3) function is defined to return NULL on failure, but chkpass.c didn't check for that before using the result. The main practical case in which this could be an issue is if libc is configured to refuse to execute unapproved hashing algorithms (e.g., "FIPS mode"). This ideally should've been a separate commit, but since it touches code adjacent to one of the buffer overrun changes, I included it in this commit to avoid last-minute merge issues. This issue was reported by Honza Horak. Security: CVE-2014-0065 for buffer overruns, CVE-2014-0066 for crypt()
* Centralize getopt-related declarations in a new header file pg_getopt.h.Tom Lane2014-02-151-5/+1
| | | | | | | | | | | | We used to have externs for getopt() and its API variables scattered all over the place. Now that we find we're going to need to tweak the variable declarations for Cygwin, it seems like a good idea to have just one place to tweak. In this commit, the variables are declared "#ifndef HAVE_GETOPT_H". That may or may not work everywhere, but we'll soon find out. Andres Freund
* Ooops, forgot to remove solar87 and friends from src/timezone/Makefile.Tom Lane2014-02-141-1/+1
| | | | Per buildfarm.
* Update time zone data files to tzdata release 2013i.Tom Lane2014-02-145-1185/+28
| | | | | | | | | | | | DST law changes in Jordan; historical changes in Cuba. Also, remove the zones Asia/Riyadh87, Asia/Riyadh88, and Asia/Riyadh89. Per the upstream announcement: The files solar87, solar88, and solar89 are no longer distributed. They were a negative experiment -- that is, a demonstration that tz data can represent solar time only with some difficulty and error. Their presence in the distribution caused confusion, as Riyadh civil time was generally not solar time in those years.
* Rename 'gmake' to 'make' in docs and recommended commandsBruce Momjian2014-02-122-3/+3
| | | | This simplifies the docs and makes it easier to cut/paste command lines.
* Update copyright for 2014Bruce Momjian2014-01-072-2/+2
| | | | | Update all files in head, and files COPYRIGHT and legal.sgml in all back branches.
* Update time zone data files to tzdata release 2013h.Tom Lane2013-12-0114-313/+412
| | | | | | DST law changes in Argentina, Brazil, Jordan, Libya, Liechtenstein, Morocco, Palestine. New timezone abbreviations WIB, WIT, WITA for Indonesia.
* Fix whitespace issues found by git diff --check, add gitattributesPeter Eisentraut2013-11-103-3/+0
| | | | | Set per file type attributes in .gitattributes to fine-tune whitespace checks. With the associated cleanups, the tree is now clean for git
* Fix some odd behaviors when using a SQL-style simple GMT offset timezone.Tom Lane2013-11-011-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Formerly, when using a SQL-spec timezone setting with a fixed GMT offset (called a "brute force" timezone in the code), the session_timezone variable was not updated to match the nominal timezone; rather, all code was expected to ignore session_timezone if HasCTZSet was true. This is of course obviously fragile, though a search of the code finds only timeofday() failing to honor the rule. A bigger problem was that DetermineTimeZoneOffset() supposed that if its pg_tz parameter was pointer-equal to session_timezone, then HasCTZSet should override the parameter. This would cause datetime input containing an explicit zone name to be treated as referencing the brute-force zone instead, if the zone name happened to match the session timezone that had prevailed before installing the brute-force zone setting (as reported in bug #8572). The same malady could affect AT TIME ZONE operators. To fix, set up session_timezone so that it matches the brute-force zone specification, which we can do using the POSIX timezone definition syntax "<abbrev>offset", and get rid of the bogus lookaside check in DetermineTimeZoneOffset(). Aside from fixing the erroneous behavior in datetime parsing and AT TIME ZONE, this will cause the timeofday() function to print its result in the user-requested time zone rather than some previously-set zone. It might also affect results in third-party extensions, if there are any that make use of session_timezone without considering HasCTZSet, but in all cases the new behavior should be saner than before. Back-patch to all supported branches.
* Update time zone data files to tzdata release 2013d.Tom Lane2013-09-028-142/+123
| | | | | DST law changes in Israel, Morocco, Palestine, Paraguay. Historical corrections for Macquarie Island.
* pgindent run for release 9.3Bruce Momjian2013-05-291-1/+1
| | | | | This is the first run of the Perl-based pgindent script. Also update pgindent instructions.
* Update time zone data files to tzdata release 2013b.Tom Lane2013-03-288-67/+324
| | | | | DST law changes in Chile, Haiti, Morocco, Paraguay, some Russian areas. Historical corrections for numerous places.
* Add missing #include.Heikki Linnakangas2013-03-251-0/+1
| | | | time(2) requires time.h.
* Update time zone abbreviation lists for changes missed since 2006.Tom Lane2013-03-236-77/+89
| | | | | | | | | | | | | | Most (all?) of Russia has moved to what's effectively year-round daylight savings time, so that the "standard" zone names now mean an hour later than they used to. Update that, notably changing MSK as per recent complaint from Sergey Konoplev, but also CHOT, GET, IRKT, KGT, KRAT, MAGT, NOVT, OMST, VLAT, YAKT, YEKT. The corresponding DST abbreviations are presumably now obsolete, but I left them in place with their old definitions, just to reduce any possible breakage from this change. Also add VOLT (Europe/Volgograd), which for some reason we never had before, as well as MIST (Antarctica/Macquarie), and fix obsolete definitions of MAWT, TKT, and WST.
* Semi-automatically detect changes in timezone abbreviations.Tom Lane2013-03-235-8/+241
| | | | | | | | | | | | | Add an option to zic.c to dump out all non-obsolete timezone abbreviations defined in the Olson database. Comparing this list to its previous state will clue us in when something happens that we may need to account for in the tznames/ time zone abbreviation lists. The README file's previous exhortation to "just grep for differences" was completely useless advice, in my now-considerable experience; but maybe this will be a bit more useful. As a starting point I built the same list from the tzdata files as they existed in 2006, which is committed here as known_abbrevs.txt. Comparison indeed turned up quite a few changes we had neglected to account for, which I will commit separately.
* Add new timezone abbrevation "FET".Tom Lane2013-01-142-0/+6
| | | | | | | This seems to have been invented in 2011 to represent GMT+3, non daylight savings rules, as now used in Europe/Kaliningrad and Europe/Minsk. There are no conflicts so might as well add it to the Default list. Per bug #7804 from Ruslan Izmaylov.
* Update copyrights for 2013Bruce Momjian2013-01-012-2/+2
| | | | | Fully update git head, and update back branches in ./COPYRIGHT and legal.sgml files.
* Update time zone data files to tzdata release 2012j.Tom Lane2012-12-026-56/+121
| | | | | DST law changes in Cuba, Israel, Jordan, Libya, Palestine, Western Samoa, and portions of Brazil.
* In our source code, make a copy of getopt's 'optarg' string arguments,Bruce Momjian2012-10-121-5/+5
| | | | rather than just storing a pointer.
* Update time zone data files to tzdata release 2012f.Tom Lane2012-09-191-3/+11
| | | | DST law changes in Fiji.
* Update time zone data files to tzdata release 2012e.Tom Lane2012-08-1419-137/+136
| | | | | | | | | | DST law changes in Morocco; Tokelau has relocated to the other side of the International Date Line; and apparently Olson had Tokelau's GMT offset wrong by an hour even before that. There are also a large number of non-significant changes in this update. Upstream took the opportunity to remove trailing whitespace, and the SCCS-style version numbers on the individual files are gone too.
* Run pgindent on 9.2 source tree in preparation for first 9.3Bruce Momjian2012-06-101-4/+4
| | | | commit-fest.
* Update time zone data files to tzdata release 2012c.Tom Lane2012-05-319-48/+358
| | | | | | DST law changes in Antarctica, Armenia, Chile, Cuba, Falkland Islands, Gaza, Haiti, Hebron, Morocco, Syria, Tokelau Islands. Historical corrections for Canada.
* Fix edge-case behavior of pg_next_dst_boundary().Tom Lane2012-04-251-11/+12
| | | | | | | | | | | | | | | | | | | Due to rather sloppy thinking (on my part, I'm afraid) about the appropriate behavior for boundary conditions, pg_next_dst_boundary() gave undefined, platform-dependent results when the input time is exactly the last recorded DST transition time for the specified time zone, as a result of fetching values one past the end of its data arrays. Change its specification to be that it always finds the next DST boundary *after* the input time, and adjust code to match that. The sole existing caller, DetermineTimeZoneOffset, doesn't actually care about this distinction, since it always uses a probe time earlier than the instant that it does care about. So it seemed best to me to change the API to make the result=1 and result=0 cases more consistent, specifically to ensure that the "before" outputs always describe the state at the given time, rather than hacking the code to obey the previous API comment exactly. Per bug #6605 from Sergey Burladyan. Back-patch to all supported versions.
* Lots of doc corrections.Robert Haas2012-04-232-2/+2
| | | | Josh Kupershmidt
* Update copyright notices for year 2012.Bruce Momjian2012-01-012-2/+2
|
* Update time zone data files to tzdata release 2011n.Tom Lane2011-11-308-54/+294
| | | | | DST law changes in Brazil, Cuba, Fiji, Palestine, Russia, Samoa. Historical corrections for Alaska and British East Africa.
* Update docs to point to the timezone library's new home at IANA.Tom Lane2011-10-271-3/+6
| | | | | The recent unpleasantness with copyrights has accelerated a move that was already in planning.
* Simplify handling of the timezone GUC by making initdb choose the default.Tom Lane2011-09-092-1225/+68
| | | | | | | | | | | We were doing some amazingly complicated things in order to avoid running the very expensive identify_system_timezone() procedure during GUC initialization. But there is an obvious fix for that, which is to do it once during initdb and have initdb install the system-specific default into postgresql.conf, as it already does for most other GUC variables that need system-environment-dependent defaults. This means that the timezone (and log_timezone) settings no longer have any magic behavior in the server. Per discussion.
* Update time zone data files to tzdata release 2011i.Tom Lane2011-09-059-70/+259
| | | | DST law changes in Canada, Egypt, Russia, Samoa, South Sudan.
* Use consistent format for reporting GetLastError()Peter Eisentraut2011-08-231-2/+2
| | | | | | Use something like "error code %lu" for reporting GetLastError() values on Windows. Previously, a mix of different wordings and formats were in use.
* Replace printf format %i by %dPeter Eisentraut2011-07-261-5/+5
| | | | | They are identical, but the overwhelming majority of the code uses %d, so standardize on that.
* Pgindent run before 9.1 beta2.Bruce Momjian2011-06-091-3/+3
|
* Split PGC_S_DEFAULT into two values, for true boot_val vs computed default.Tom Lane2011-05-111-10/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Failure to distinguish these cases is the real cause behind the recent reports of Windows builds crashing on 'infinity'::timestamp, which was directly due to failure to establish a value of timezone_abbreviations in postmaster child processes. The postmaster had the desired value, but write_one_nondefault_variable() didn't transmit it to backends. To fix that, invent a new value PGC_S_DYNAMIC_DEFAULT, and be sure to use that or PGC_S_ENV_VAR (as appropriate) for "default" settings that are computed during initialization. (We need both because there's at least one variable that could receive a value from either source.) This commit also fixes ProcessConfigFile's failure to restore the correct default value for certain GUC variables if they are set in postgresql.conf and then removed/commented out of the file. We have to recompute and reinstall the value for any GUC variable that could have received a value from PGC_S_DYNAMIC_DEFAULT or PGC_S_ENV_VAR sources, and there were a number of oversights. (That whole thing is a crock that needs to be redesigned, but not today.) However, I intentionally didn't make it work "exactly right" for the cases of timezone and log_timezone. The exactly right behavior would involve running select_default_timezone, which we'd have to do independently in each postgres process, causing the whole database to become entirely unresponsive for as much as several seconds. That didn't seem like a good idea, especially since the variable's removal from postgresql.conf might be just an accidental edit. Instead the behavior is to adopt the previously active setting as if it were default. Note that this patch creates an ABI break for extensions that use any of the PGC_S_XXX constants; they'll need to be recompiled.
* Assorted minor changes to silence Windows compiler warnings.Andrew Dunstan2011-04-251-2/+2
| | | | Mostly to do with macro redefinitions or object signedness.
* Update time zone data files to tzdata release 2011f.Tom Lane2011-04-139-65/+304
| | | | | DST law changes in Chile, Cuba, Falkland Islands, Morocco, Samoa, Turkey. Historical corrections for South Australia, Alaska, Hawaii.
* Revise the API for GUC variable assign hooks.Tom Lane2011-04-071-12/+24
| | | | | | | | | | | | | | | | | The previous functions of assign hooks are now split between check hooks and assign hooks, where the former can fail but the latter shouldn't. Aside from being conceptually clearer, this approach exposes the "canonicalized" form of the variable value to guc.c without having to do an actual assignment. And that lets us fix the problem recently noted by Bernd Helmle that the auto-tune patch for wal_buffers resulted in bogus log messages about "parameter "wal_buffers" cannot be changed without restarting the server". There may be some speed advantage too, because this design lets hook functions avoid re-parsing variable values when restoring a previous state after a rollback (they can store a pre-parsed representation of the value instead). This patch also resolves a longstanding annoyance about custom error messages from variable assign hooks: they should modify, not appear separately from, guc.c's own message about "invalid parameter value".
* Stamp copyrights for year 2011.Bruce Momjian2011-01-012-2/+2
|
* Update time zone data files to tzdata release 2010o: DST law changes inTom Lane2010-12-133-8/+31
| | | | Fiji and Samoa. Historical corrections for Hong Kong.
* Improved parallel make supportPeter Eisentraut2010-11-121-2/+2
| | | | | | | | Replace for loops in makefiles with proper dependencies. Parallel make can now span across directories. Also, make -k and make -q work properly. GNU make 3.80 or newer is now required.
* Fix comparisons of pointers with zero to compare with NULL instead.Tom Lane2010-10-291-6/+6
| | | | | | | Per C standard, these are semantically the same thing; but saying NULL when you mean NULL is good for readability. Marti Raudsepp, per results of INRIA's Coccinelle.
* Convert cvsignore to gitignore, and add .gitignore for build targets.Magnus Hagander2010-09-221-0/+1
|
* Remove cvs keywords from all files.Magnus Hagander2010-09-2026-26/+26
|
* Update time zone data files to tzdata release 2010l: DST law changes inTom Lane2010-08-2610-31/+168
| | | | | | | Egypt and Palestine. Added new names for two Micronesian timezones: Pacific/Chuuk is now preferred over Pacific/Truk (and the preferred abbreviation is CHUT not TRUT) and Pacific/Pohnpei is preferred over Pacific/Ponape. Historical corrections for Finland.
* pgindent run for 9.0, second runBruce Momjian2010-07-061-13/+13
|
* Split the LDFLAGS make variable into two parts: LDFLAGS is now used forTom Lane2010-07-051-2/+2
| | | | | | | | | | | | | linking both executables and shared libraries, and we add on LDFLAGS_EX when linking executables or LDFLAGS_SL when linking shared libraries. This provides a significantly cleaner way of dealing with link-time switches than the former behavior. Also, make sure that the various platform-specific %.so: %.o rules incorporate LDFLAGS and LDFLAGS_SL; most of them missed that before. (I did not add these variables for the platforms that invoke $(LD) directly, however. It's not clear if we can do that safely, since for the most part we assume these variables use CC command-line syntax.) Per gripe from Aaron Swenson and subsequent investigation.
* Change the "N. Central Asia Standard Time" timezone to map toMagnus Hagander2010-05-201-3/+3
| | | | | | | | | | Asia/Novosibirsk on Windows. Microsoft changed the behaviour of this zone in the timezone update from KB976098. The zones differ in handling of DST, and the old zone was just removed. Noted by Dmitry Funk
* Update time zone data files to tzdata release 2010j: DST law changes inTom Lane2010-05-118-58/+287
| | | | | Argentina, Australian Antarctic, Bangladesh, Mexico, Morocco, Pakistan, Palestine, Russia, Syria, Tunisia. Historical corrections for Taiwan.