Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wr8GN-0003tx-Gj for pgsql-general@arkaria.postgresql.org; Sun, 01 Jun 2014 16:05:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wr8GM-0006r5-MV for pgsql-general@arkaria.postgresql.org; Sun, 01 Jun 2014 16:05:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Wr8GK-0006qu-OZ for pgsql-general@postgresql.org; Sun, 01 Jun 2014 16:05:33 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Wr8G8-0002vx-7u for pgsql-general@postgresql.org; Sun, 01 Jun 2014 16:05:31 +0000 Received: from compute5.internal (compute5.nyi.mail.srv.osa [10.202.2.45]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 8A09521B2F for ; Sun, 1 Jun 2014 12:05:16 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Sun, 01 Jun 2014 12:05:16 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h= message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=ST9Vtm23FvqZV96whDB6+7zGwXg=; b=RcZ01B5D3nQP4EqaYIxL4AO4xb/T QWWhGGASr46OP1yFDwgy2rGSTMxJ+BRSKk15As3yy1hNevN9ZX2ypCGmWg6INccR g8iNonB0AEwyo65lBfQDTuY+Y45bain4xz3J1mWNO0JZoxZU35oTg2l+iWJl3ztp 5WLsdHu24XQXgSE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=ST9Vtm23FvqZV96whDB6+7 zGwXg=; b=eNpE6EFp6HVGfYkfs0Rqf2g9fshWJd4tqDa/A/g1LPPgDCJdfYux1a C2jSFVkYdcGMleLn+Bn9sQaWeAEivNtjLSMItXJawHpDKc9yORXvju4B4CCBE7wp K70fTkYlJe8oLGMwLpZPKfzzcktqZXT7SiewF3k5o8yXSQCGohY0Q= X-Sasl-enc: hCKr48bkVIm8R4Tgqaiyf2CcWRbwkH0Sxacphugqt5QE 1401638716 Received: from panda.site (unknown [65.102.186.57]) by mail.messagingengine.com (Postfix) with ESMTPA id DBB95C007AA; Sun, 1 Jun 2014 12:05:15 -0400 (EDT) Message-ID: <538B4F3B.5070006@aklaver.com> Date: Sun, 01 Jun 2014 09:05:15 -0700 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: David Wall , pgsql-general@postgresql.org Subject: Re: Upgrading from PG 8.3.3 to 9.3.4 - FATAL: invalid value for parameter "TimeZone": "PST" References: <538ACAFE.1050404@computer.org> <538ACC7D.9050302@hogranch.com> <538AD2C7.6080107@yozons.com> <538AD36A.3010002@computer.org> In-Reply-To: <538AD36A.3010002@computer.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 06/01/2014 12:16 AM, David Wall wrote: >> On 5/31/2014 11:47 PM, John R Pierce wrote: >>> On 5/31/2014 11:41 PM, David Wall wrote: >>>> >>>> FATAL: invalid value for parameter "TimeZone": "PST" >>> >>> I'd be using "America/Los_Angeles" as the timezone rather than PST, >>> as the TLA timezones are ambiguous (CST is both Central Standard Time >>> in the USA, and China Standard Time). >>> >>> but thats probably not the problem, hard to guess what is, sounds >>> like you have a lot going on. >> > > PG itself has the timezone US/Pacific set in postgresql.conf > > In Linux, we show: > lrwxrwxrwx 1 root root 39 Apr 23 16:00 /etc/localtime -> > /usr/share/zoneinfo/America/Los_Angeles > > Even when we use PST in our Java code, we use PST8PDT. > > The exception occurs when JDBC tries to connect to PG: > > 2014-05-31 22:14:34,351 ERROR (eSignForms) SQLException: > ConnectionPool.makeConnection(esf) to URL: > jdbc:postgresql://localhost.localdomain:25432/zingr: > 2014-05-31 22:14:34,352 ERROR (eSignForms) Message: FATAL: invalid > value for parameter "TimeZone": "PST" > org.postgresql.util.PSQLException: FATAL: invalid value for parameter > "TimeZone": "PST" > And of course none seems to explain why it works often enough, but then > fails as more apps are deployed. Ugh! What version of Postgres JDBC are you using on your 8.3.3 machine? I ask because a look at the PG JDBC code shows this, which did not show up until Sept 22, 2011. Not sure what release, but it looks like 9.2+: // Construct and send a startup packet. String[][] params = { { "user", user }, { "database", database }, { "client_encoding", "UTF8" }, { "DateStyle", "ISO" }, { "extra_float_digits", "2" }, { "TimeZone", createPostgresTimeZone() }, /** * Convert Java time zone to postgres time zone. * All others stay the same except that GMT+nn changes to GMT-nn and * vise versa. * * @return The current JVM time zone in postgresql format. */ private String createPostgresTimeZone() { String tz = TimeZone.getDefault().getID(); if (tz.length() <= 3 || !tz.startsWith("GMT")) { return tz; } char sign = tz.charAt(3); String start; if (sign == '+') { start = "GMT-"; } else if (sign == '-') { start = "GMT+"; } else { // unknown type return tz; } return start + tz.substring(4); Ahh I see the problem. From here: A time zone abbreviation, for example PST. Such a specification merely defines a particular offset from UTC, in contrast to full time zone names which can imply a set of daylight savings transition-date rules as well. The recognized abbreviations are listed in the pg_timezone_abbrevs view (see Section 47.70). You cannot set the ^^^^^^^^^^^^^^^^^^ configuration parameters TimeZone or log_timezone to a time zone ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ abbreviation, but you can use abbreviations in date/time input values ^^^^^^^^^^^^^ and with the AT TIME ZONE operator. So: test=> select version(); version ----------------------------------------------------------------------------------------------------------------------------- PostgreSQL 9.3.4 on i686-pc-linux-gnu, compiled by gcc (SUSE Linux) 4.7.2 20130108 [gcc-4_7-branch revision 195012], 32-bit (1 row) test=> set TimeZone='PST'; ERROR: invalid value for parameter "TimeZone": "PST" test=> set TimeZone='PST8PDT'; SET The JDBC code above, if I am following correctly, is picking up a default timezone of 'PST' and then in the first if returning that as the tz value to SET TimeZone in the startup packet. Two things. 1) Where is it getting PST from ? 2) Should the driver even be returning an abbreviation given that Postgres will not accept it as a TimeZone value? > > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general