mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
Sync our copy of the timezone library with IANA release tzcode2016c.
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.
This commit is contained in:
@ -256,7 +256,7 @@ pg_tzset(const char *name)
|
||||
*/
|
||||
if (strcmp(uppername, "GMT") == 0)
|
||||
{
|
||||
if (tzparse(uppername, &tzstate, TRUE) != 0)
|
||||
if (tzparse(uppername, &tzstate, true) != 0)
|
||||
{
|
||||
/* This really, really should not happen ... */
|
||||
elog(ERROR, "could not initialize GMT time zone");
|
||||
@ -264,9 +264,9 @@ pg_tzset(const char *name)
|
||||
/* Use uppercase name as canonical */
|
||||
strcpy(canonname, uppername);
|
||||
}
|
||||
else if (tzload(uppername, canonname, &tzstate, TRUE) != 0)
|
||||
else if (tzload(uppername, canonname, &tzstate, true) != 0)
|
||||
{
|
||||
if (uppername[0] == ':' || tzparse(uppername, &tzstate, FALSE) != 0)
|
||||
if (uppername[0] == ':' || tzparse(uppername, &tzstate, false) != 0)
|
||||
{
|
||||
/* Unknown timezone. Fail our call instead of loading GMT! */
|
||||
return NULL;
|
||||
@ -460,7 +460,7 @@ pg_tzenumerate_next(pg_tzenum *dir)
|
||||
* the cache
|
||||
*/
|
||||
if (tzload(fullname + dir->baselen, dir->tz.TZname, &dir->tz.state,
|
||||
TRUE) != 0)
|
||||
true) != 0)
|
||||
{
|
||||
/* Zone could not be loaded, ignore it */
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user