1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-24 09:27:52 +03:00

Sync our copy of the timezone library with IANA release tzcode2019a.

This corrects a small bug in zic that caused it to output an incorrect
year-2440 transition in the Africa/Casablanca zone.

More interestingly, zic has grown a "-r" option that limits the range of
zone transitions that it will put into the output files.  That might be
useful to people who don't like the weird GMT offsets that tzdb likes
to use for very old dates.  It appears that for dates before the cutoff
time specified with -r, zic will use the zone's standard-time offset
as of the cutoff time.  So for example one might do

	make install ZIC_OPTIONS='-r @-1893456000'

to cause all dates before 1910-01-01 to be treated as though 1910
standard time prevailed indefinitely far back.  (Don't blame me for
the unfriendly way of specifying the cutoff time --- it's seconds
since or before the Unix epoch.  You can use extract(epoch ...)
to calculate it.)

As usual, back-patch to all supported branches.
This commit is contained in:
Tom Lane
2019-04-26 19:46:26 -04:00
parent d312de3fc0
commit acb897b806
5 changed files with 237 additions and 83 deletions

View File

@@ -44,6 +44,14 @@
/* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
#define is_digit(c) ((unsigned)(c) - '0' <= 9)
/* PG doesn't currently rely on <inttypes.h>, so work around strtoimax() */
#undef strtoimax
#ifdef HAVE_STRTOLL
#define strtoimax strtoll
#else
#define strtoimax strtol
#endif
/*
* Finally, some convenience items.