We're not lax enough about maximum time zone offset from UTC

Lists: pgsql-hackers
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Cc: Patric Bechtel <patric(dot)bechtel(at)gmail(dot)com>
Subject: We're not lax enough about maximum time zone offset from UTC
Date: 2012-05-30 22:10:12
Message-ID: 10520.1338415812@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Currently, our datetime input code thinks that any UTC offset of more
than 14:59:59 either way from Greenwich must be a mistake. However,
after seeing Patric Bechtel's recent bug report, I went trolling in the
Olson timezone files to see what are the largest offsets used there.
I found three entries that are further out than that:

# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Manila -15:56:00 - LMT 1844 Dec 31
Zone America/Juneau 15:02:19 - LMT 1867 Oct 18
Zone America/Metlakatla 15:13:42 - LMT 1867 Oct 18

These are all ancient history of course; it does not appear that any
zones *currently* use offsets larger than +/- 14 hours, which if memory
serves is what we considered when we set the existing sanity limit.

However, as pointed out by Patric, if you dump and restore an old
timestamptz value in one of these zones, it will fail to restore because
of the sanity check. I think therefore that we'd better enlarge the
allowed range to 15:59:59 either way.

regards, tom lane


From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org, Patric Bechtel <patric(dot)bechtel(at)gmail(dot)com>
Subject: Re: We're not lax enough about maximum time zone offset from UTC
Date: 2012-05-30 23:07:23
Message-ID: 3243D7B2-982F-4A45-B8CC-6478B839E4B0@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On May 30, 2012, at 3:10 PM, Tom Lane wrote:

> However, as pointed out by Patric, if you dump and restore an old
> timestamptz value in one of these zones, it will fail to restore because
> of the sanity check. I think therefore that we'd better enlarge the
> allowed range to 15:59:59 either way.

Should you be validating them on a per-time zone basis? Or does it matter?

David


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Patric Bechtel <patric(dot)bechtel(at)gmail(dot)com>
Subject: Re: We're not lax enough about maximum time zone offset from UTC
Date: 2012-05-30 23:33:40
Message-ID: 13846.1338420820@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"David E. Wheeler" <david(at)justatheory(dot)com> writes:
> On May 30, 2012, at 3:10 PM, Tom Lane wrote:
>> However, as pointed out by Patric, if you dump and restore an old
>> timestamptz value in one of these zones, it will fail to restore because
>> of the sanity check. I think therefore that we'd better enlarge the
>> allowed range to 15:59:59 either way.

> Should you be validating them on a per-time zone basis? Or does it matter?

We can't really --- a given input string should be valid, or not,
independently of what TimeZone is set to. If we change that we're far
too likely to break scenarios that work now.

regards, tom lane


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org, Patric Bechtel <patric(dot)bechtel(at)gmail(dot)com>
Subject: Re: We're not lax enough about maximum time zone offset from UTC
Date: 2012-08-30 20:40:48
Message-ID: 20120830204048.GV8753@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, May 30, 2012 at 06:10:12PM -0400, Tom Lane wrote:
> Currently, our datetime input code thinks that any UTC offset of more
> than 14:59:59 either way from Greenwich must be a mistake. However,
> after seeing Patric Bechtel's recent bug report, I went trolling in the
> Olson timezone files to see what are the largest offsets used there.
> I found three entries that are further out than that:
>
> # Zone NAME GMTOFF RULES FORMAT [UNTIL]
> Zone Asia/Manila -15:56:00 - LMT 1844 Dec 31
> Zone America/Juneau 15:02:19 - LMT 1867 Oct 18
> Zone America/Metlakatla 15:13:42 - LMT 1867 Oct 18
>
> These are all ancient history of course; it does not appear that any
> zones *currently* use offsets larger than +/- 14 hours, which if memory
> serves is what we considered when we set the existing sanity limit.
>
> However, as pointed out by Patric, if you dump and restore an old
> timestamptz value in one of these zones, it will fail to restore because
> of the sanity check. I think therefore that we'd better enlarge the
> allowed range to 15:59:59 either way.

Any status on this?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org, Patric Bechtel <patric(dot)bechtel(at)gmail(dot)com>
Subject: Re: We're not lax enough about maximum time zone offset from UTC
Date: 2012-08-30 20:51:02
Message-ID: 1054.1346359862@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> On Wed, May 30, 2012 at 06:10:12PM -0400, Tom Lane wrote:
>> However, as pointed out by Patric, if you dump and restore an old
>> timestamptz value in one of these zones, it will fail to restore because
>> of the sanity check. I think therefore that we'd better enlarge the
>> allowed range to 15:59:59 either way.

> Any status on this?

Shipped in last week's updates.

regards, tom lane


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org, Patric Bechtel <patric(dot)bechtel(at)gmail(dot)com>
Subject: Re: We're not lax enough about maximum time zone offset from UTC
Date: 2012-08-30 20:53:02
Message-ID: 20120830205302.GY8753@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Aug 30, 2012 at 04:51:02PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > On Wed, May 30, 2012 at 06:10:12PM -0400, Tom Lane wrote:
> >> However, as pointed out by Patric, if you dump and restore an old
> >> timestamptz value in one of these zones, it will fail to restore because
> >> of the sanity check. I think therefore that we'd better enlarge the
> >> allowed range to 15:59:59 either way.
>
> > Any status on this?
>
> Shipped in last week's updates.

Thank you.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +