1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-12 21:01:52 +03:00

Sync tzload() and tzparse() APIs with IANA release tzcode2016c.

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.
This commit is contained in:
Tom Lane
2016-03-28 17:19:29 -04:00
parent f5f15ea6aa
commit 1f4e9da624
4 changed files with 26 additions and 29 deletions

View File

@ -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))
{
/* This really, really should not happen ... */
elog(ERROR, "could not initialize GMT time zone");
@ -266,7 +266,7 @@ pg_tzset(const char *name)
}
else if (tzload(uppername, canonname, &tzstate, true) != 0)
{
if (uppername[0] == ':' || tzparse(uppername, &tzstate, false) != 0)
if (uppername[0] == ':' || !tzparse(uppername, &tzstate, false))
{
/* Unknown timezone. Fail our call instead of loading GMT! */
return NULL;