Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id A4D601337BA6 for ; Mon, 21 Mar 2011 10:19:31 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 20759-02 for ; Mon, 21 Mar 2011 13:19:23 +0000 (UTC) X-Greylist: delayed 00:05:21.077196 by SQLgrey-1.7.6 Received: from nm5-vm0.bullet.mail.bf1.yahoo.com (nm5-vm0.bullet.mail.bf1.yahoo.com [98.139.213.150]) by mail.postgresql.org (Postfix) with SMTP id 7C1451337BA3 for ; Mon, 21 Mar 2011 10:19:23 -0300 (ADT) Received: from [98.139.212.152] by nm5.bullet.mail.bf1.yahoo.com with NNFMP; 21 Mar 2011 13:14:02 -0000 Received: from [98.139.213.11] by tm9.bullet.mail.bf1.yahoo.com with NNFMP; 21 Mar 2011 13:14:02 -0000 Received: from [127.0.0.1] by smtp111.mail.bf1.yahoo.com with NNFMP; 21 Mar 2011 13:14:02 -0000 X-Yahoo-Newman-Id: 280735.89056.bm@smtp111.mail.bf1.yahoo.com Received: from jonathanlaptop (JB@67.34.121.27 with login) by smtp111.mail.bf1.yahoo.com with SMTP; 21 Mar 2011 06:14:00 -0700 PDT X-Yahoo-SMTP: 44.80yyswBBWn2mP4eIs.OiF0CguW7wtDDCwTEpCAZ4GQXK1x4I- X-YMail-OSG: fhVkirsVM1mka90122puRPDNLmwWf_zVFLE6bPW4vOAr6JC _6asCb5gfdxDCOQdEd6csTexKpua59HUXFo30oHn06_t6X7IobDrzfJPPwZi j_G8G42PdYh2e0cSWKgp8fyIPbqOSyihMLV_d9sJ7Fzppkx5GoEkmOvK073L 6vD3mfL8oEwT_Il0038MQ9CZghQtZcV5fEb01MiufKZTcf39UXi0bdlW9511 fsI43Iq349qC1jr2atOYs0xfoNFGTrlpxOQ-- X-Yahoo-Newman-Property: ymail-3 Reply-To: From: "Jonathan Brinkman" To: "'Tom Lane'" , "'Kevin Grittner'" Cc: References: <004c01cbe57c$7d920ca0$78b625e0$@com> <15708.1300462903@sss.pgh.pa.us> <005601cbe585$bc7d4b10$3577e130$@com> <4D834322020000250003BABD@gw.wicourts.gov> <17126.1300466813@sss.pgh.pa.us> In-Reply-To: <17126.1300466813@sss.pgh.pa.us> Subject: Re: TO_CHAR(timestamptz,datetimeformat) wrong after DST change Date: Mon, 21 Mar 2011 09:13:44 -0400 Organization: BlackSky Technologies, Inc. Message-ID: <000c01cbe7c9$d7cf2230$876d6690$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 thread-index: AcvlkKgwuoBbLrPyRNuoZZMvWwMW6ACN/xKQ Content-Language: en-us X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, UNPARSEABLE_RELAY=0.001 X-Spam-Level: X-Archive-Number: 201103/258 X-Sequence-Number: 29768 I understand now that I must use America/New_York for DST to function. I see in select * from pg_timezone_names ; that 'EDT' is a shortcut. I tried to SET TIME ZONE 'EDT'; but PG doesn't seem to like that. My problem is that the corrected time zone (America/New_York) doesn't seem to stick after updating. I update it in psql (cmd line) and within psql it returns correctly. But when I then view now() from command line the DST change is not there and time zone is again 'EST'. So: postgres@Cloud-DB1:~$ psql beta_cms_main -c "SHOW TIME ZONE;" TimeZone ---------- EST (1 row) postgres@Cloud-DB1:~$ psql beta_cms_main psql (8.4.7) Type "help" for help. beta_cms_main=# show time zone; TimeZone ---------- EST (1 row) beta_cms_main=# set time zone 'America/New_York'; SET beta_cms_main=# show time zone; TimeZone ------------------ America/New_York (1 row) beta_cms_main=# \q postgres@Cloud-DB1:~$ psql beta_cms_main -c "SHOW TIME ZONE;" TimeZone ---------- EST (1 row) postgres@Cloud-DB1:~$ psql beta_cms_main -c "select now();" now ------------------------------- 2011-03-21 08:09:07.029884-05 (1 row) [INCORRECT, SHOULD BE -04 and it is now 9:09AM, not 8:09AM] I enabled America/New_York in postgresql.conf and restarted PG but no change. I re-ran tzdata in Ubuntu but no change. I rebooted the server no change. -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Sent: Friday, March 18, 2011 12:47 PM To: Kevin Grittner Cc: JB@BlackSkyTech.com; pgsql-bugs@postgresql.org Subject: Re: [BUGS] TO_CHAR(timestamptz,datetimeformat) wrong after DST change "Kevin Grittner" writes: > "Jonathan Brinkman" wrote: >> I guess EST is not DST-friendly? > EST stands for Eastern *Standard* Time, which is explicitly *not* > under Daylight Saving Time. Right. SET TIMEZONE 'EST' gets you GMT-5 all year round. For background see this bit in src/timezone/data/northamerica: # From Arthur David Olson, 2005-12-19 # We generate the files specified below to guard against old files with # obsolete information being left in the time zone binary directory. # We limit the list to names that have appeared in previous versions of # this time zone package. # We do these as separate Zones rather than as Links to avoid problems if # a particular place changes whether it observes DST. # We put these specifications here in the northamerica file both to # increase the chances that they'll actually get compiled and to # avoid the need to duplicate the US rules in another file. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone EST -5:00 - EST Zone MST -7:00 - MST Zone HST -10:00 - HST Zone EST5EDT -5:00 US E%sT Zone CST6CDT -6:00 US C%sT Zone MST7MDT -7:00 US M%sT Zone PST8PDT -8:00 US P%sT (Note: the lack of a RULES entry means no DST rule.) regards, tom lane