diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-05-30 19:58:54 -0400 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-05-30 19:58:54 -0400 |
| commit | f5c5e7497b6057151936313d0cdb6cc8dc159331 (patch) | |
| tree | 157a2da86ec3b78610f8a840c379f0efa666adc7 /src/include | |
| parent | 4c95cdabce4993c7c016b664dac73c5c7ed9770b (diff) | |
Expand the allowed range of timezone offsets to +/-15:59:59 from Greenwich.
We used to only allow offsets less than +/-13 hours, then it was +/14,
then it was +/-15. That's still not good enough though, as per today's bug
report from Patric Bechtel. This time I actually looked through the Olson
timezone database to find the largest offsets used anywhere. The winners
are Asia/Manila, at -15:56:00 until 1844, and America/Metlakatla, at
+15:13:42 until 1867. So we'd better allow offsets less than +/-16 hours.
Given the history, we are way overdue to have some greppable #define
symbols controlling this, so make some ... and also remove an obsolete
comment that didn't get fixed the last time.
Back-patch to all supported branches.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/utils/timestamp.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/include/utils/timestamp.h b/src/include/utils/timestamp.h index ab74d8e9cf0..d515c70c507 100644 --- a/src/include/utils/timestamp.h +++ b/src/include/utils/timestamp.h @@ -101,6 +101,16 @@ typedef struct #endif /* + * We allow numeric timezone offsets up to 15:59:59 either way from Greenwich. + * Currently, the record holders for wackiest offsets in actual use are zones + * Asia/Manila, at -15:56:00 until 1844, and America/Metlakatla, at +15:13:42 + * until 1867. If we were to reject such values we would fail to dump and + * restore old timestamptz values with these zone settings. + */ +#define MAX_TZDISP_HOUR 15 /* maximum allowed hour part */ +#define TZDISP_LIMIT ((MAX_TZDISP_HOUR + 1) * SECS_PER_HOUR) + +/* * Macros for fmgr-callable functions. * * For Timestamp, we make use of the same support routines as for int64 |
