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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: dgillis(at)dystillr(dot)com
Cc: 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 20:35:41
Message-ID: 24902.1405974941@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

dgillis(at)dystillr(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G Johnston 2014-07-21 21:15:49 Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone.
Previous Message Jeff Fischer 2014-07-21 20:34:54 Re: BUG #10972: string_agg function incorrectly concatenating varying delimiter