Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone.
Date
Msg-id 24902.1405974941@sss.pgh.pa.us
Whole thread Raw
In response to BUG #11014: Postgres can be put into an error state by setting invalid timezone.  (dgillis@dystillr.com)
Responses Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone.
Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone.
List pgsql-bugs
dgillis@dystillr.com 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?

            regards, tom lane

pgsql-bugs by date:

Previous
From: dgillis@dystillr.com
Date:
Subject: BUG #11014: Postgres can be put into an error state by setting invalid timezone.
Next
From: David G Johnston
Date:
Subject: Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone.