Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone.

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone.
Date: 2014-07-21 21:15:49
Message-ID: 1405977349153-5812283.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tom Lane-2 wrote
> dgillis@

> writes:
>> postgres=# set timezone='-0400';
>> SET
>> postgres=#
>> postgres=# show timezone;
>> TimeZone
>> ----------
>> unknown
>> (1 row)
>
>> postgres=# select now();
>> The connection to the server was lost. Attempting reset: Failed.
>
> Oh, hm, looks like it didn't occur to us that pg_tzset could reject
> out-of-range input :-(.
>
> Previous versions of PG would allow this, interpreting the GMT offset
> as 400 hours. In 9.4, the data is fed to the zic library, which thinks
> that the zone offset shouldn't exceed 1 week (168 hours); and we're
> not defending against a null result.
>
> While it's easy enough to add an error check, I wonder if there's an
> actual use-case for such a large zone offset? Or were you just
> playing around?

This does seem kind of a harsh for a mis-understanding that one cannot
specify a hours offset as a valid timezone identifier. ISTM the OP was
trying to set the timezone to EDT by specifying a -04 hours and 00 minutes
offset (- 04 00 = -0400 )...a 4-digit input like this shouldn't be
considered a -400 hour GMT offset...

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-11014-Postgres-can-be-put-into-an-error-state-by-setting-invalid-timezone-tp5812271p5812283.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-07-21 22:56:01 Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone.
Previous Message Tom Lane 2014-07-21 20:35:41 Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone.