postgresql/src/timezone
Tom Lane 6e5a39c9e6 Reject out-of-range numeric timezone specifications.
In commit 631dc390f4, we started to handle
simple numeric timezone offsets via the zic library instead of the old
CTimeZone/HasCTZSet kluge.  However, we overlooked the fact that the zic
code will reject UTC offsets exceeding a week (which seems a bit arbitrary,
but not because it's too tight ...).  This led to possibly setting
session_timezone to NULL, which results in crashes in most timezone-related
operations as of 9.4, and crashes in a small number of places even before
that.  So check for NULL return from pg_tzset_offset() and report an
appropriate error message.  Per bug #11014 from Duncan Gillis.

Back-patch to all supported branches, like the previous patch.
(Unfortunately, as of today that no longer includes 8.4.)
2014-07-21 22:41:36 -04:00
..
data Update time zone data files to tzdata release 2014e. 2014-07-19 15:01:38 -04:00
tznames Update time zone data files to tzdata release 2013h. 2013-12-01 14:12:12 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:06 +02:00
ialloc.c Update timezone code to track the upstream changes since 2003. In particular 2008-02-16 21:16:04 +00:00
known_abbrevs.txt Update time zone data files to tzdata release 2013h. 2013-12-01 14:12:12 -05:00
localtime.c Remove tabs after spaces in C comments 2014-05-06 11:26:25 -04:00
Makefile Ooops, forgot to remove solar87 and friends from src/timezone/Makefile. 2014-02-14 23:20:27 -05:00
pgtz.c Reject out-of-range numeric timezone specifications. 2014-07-21 22:41:36 -04:00
pgtz.h Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
private.h 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
README Update docs to point to the timezone library's new home at IANA. 2011-10-27 23:09:15 -04:00
scheck.c Update timezone code to track the upstream changes since 2003. In particular 2008-02-16 21:16:04 +00:00
strftime.c Sync timezone code with tzcode 2010c from the Olson group. This fixes some 2010-03-11 18:43:24 +00:00
tzfile.h 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list 2009-06-11 14:49:15 +00:00
zic.c Small adjustment by pgindent. 2010-03-13 00:40:43 +00:00

src/timezone/README

Timezone
========

This is a PostgreSQL adapted version of the timezone library from
http://www.iana.org/time-zones

The source code can be found at:

	ftp://ftp.iana.org/tz/releases/tzcode*.tar.gz

The code is currently synced with release 2010c.  There are many cosmetic
(and not so cosmetic) differences from the original tzcode library, but
diffs in the upstream version should usually be propagated to our version.

The data files under data/ are an exact copy of the latest data set from:

	ftp://ftp.iana.org/tz/releases/tzdata*.tar.gz

Since time zone rules change frequently in some parts of the world,
we should endeavor to update the data files before each PostgreSQL
release.

At each update, we should check if time zone offsets have changed.
Just search for the current or previous year and see what has changed.
Sometimes a country changes its time zone offsets, for example Georgia
in 2004.  Just grepping in the zic database files for 2004 is enough to
spot such a change.  Then the files under tznames/ should be updated.

When there has been a new release of Windows (probably including Service
Packs), the list of matching timezones need to be updated. Run the
script in src/tools/win32tzlist.pl on a Windows machine running this new
release and apply any new timezones that it detects. Never remove any
mappings in case they are removed in Windows, since we still need to
match properly on the old version.