Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y3nbi-0005f6-S7 for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Dec 2014 15:12:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y3nbi-0002pn-C9 for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Dec 2014 15:12:14 +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 1Y3nbh-0002ph-NU for pgsql-bugs@postgresql.org; Wed, 24 Dec 2014 15:12:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y3nbe-0001PH-2k for pgsql-bugs@postgresql.org; Wed, 24 Dec 2014 15:12:12 +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 sBOFBw5T006077; Wed, 24 Dec 2014 10:11:58 -0500 From: Tom Lane To: =?UTF-8?B?5byg5Lqa55Cq?= cc: John R Pierce , pgsql-bugs@postgresql.org Subject: Re: BUG #12326: I think maybe postgresql has a problem about timezone. In-reply-to: References: <20141224095423.11501.9655@wrigleys.postgresql.org> <549A91A7.7000500@hogranch.com> Comments: In-reply-to =?UTF-8?B?5byg5Lqa55Cq?= message dated "Wed, 24 Dec 2014 19:15:49 +0800" Date: Wed, 24 Dec 2014 10:11:58 -0500 Message-ID: <6076.1419433918@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 =?UTF-8?B?5byg5Lqa55Cq?= writes: > show timezone; > TimeZone > ---------- > PRC > (1 row) > # update history_configuration set var_datetime = 'Wed Dec 24 18:52:46 CST >> 2014' where var_name = 'lastHourAggr'; > # select * from history_configuration ; > var_name | var_value | var_datetime > -------------------+-----------+------------------------ > lastHourAggr | | 2014-12-25 08:52:46+08 As John says, this behavior is perfectly expected because Postgres thinks "CST" means US Central Standard Time (GMT-6, currently). If you want CST to mean China Standard Time, you'll need to set up a custom zone abbreviation file. See http://www.postgresql.org/docs/9.3/static/datetime-config-files.html For some reason this interpretation of "CST" got missed out when preparing the sample data in Asia.txt, but I think what you need is just @INCLUDE Default @OVERRIDE CST 28800 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