Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X9PQc-000561-Qk for pgsql-bugs@arkaria.postgresql.org; Tue, 22 Jul 2014 02:03:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X9PQc-0005bU-Ah for pgsql-bugs@arkaria.postgresql.org; Tue, 22 Jul 2014 02:03:42 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X9PQa-0005bL-9h for pgsql-bugs@postgresql.org; Tue, 22 Jul 2014 02:03:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X9PQT-0004i2-4r for pgsql-bugs@postgresql.org; Tue, 22 Jul 2014 02:03:38 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s6M239TL018033; Mon, 21 Jul 2014 22:03:09 -0400 From: Tom Lane To: dgillis@dystillr.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #11014: Postgres can be put into an error state by setting invalid timezone. In-reply-to: <24902.1405974941@sss.pgh.pa.us> References: <20140721194918.27765.11913@wrigleys.postgresql.org> <24902.1405974941@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 21 Jul 2014 16:35:41 -0400" Date: Mon, 21 Jul 2014 22:03:09 -0400 Message-ID: <18032.1405994589@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org I wrote: > 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. Hmm ... I had checked that this example doesn't crash pre-9.4, but on closer inspection it turns out that the bug is indeed there pre-9.4. You just need to try specific operations that expect session_timezone to be valid always, eg timeofday(): regression=# set timezone='-0400'; SET regression=# select timeofday(); The connection to the server was lost. Attempting reset: Failed. This was introduced in commit 631dc390f49909a5c8ebd6002cfb2bcee5415a9d, which got back-patched, so it's in all the current releases. Too bad the report didn't come in a few hours earlier, we could've fixed it in this week's releases :-( regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs