Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 694D8B5DC1B for ; Wed, 21 Sep 2011 17:32:12 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 99942-04 for ; Wed, 21 Sep 2011 20:32:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 8FFCAB5DC1A for ; Wed, 21 Sep 2011 17:32:05 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p8LKVprV028649; Wed, 21 Sep 2011 16:31:51 -0400 (EDT) To: Euler Taveira de Oliveira cc: Robert Haas , pratikchirania , pgsql-bugs@postgresql.org Subject: Re: Timezone issues with Postrres In-reply-to: <4E7A4570.9040609@timbira.com> References: <1316149023380-4809498.post@n5.nabble.com> <4E7364B8.5070608@timbira.com> <1316589418035-4825401.post@n5.nabble.com> <4E7A4570.9040609@timbira.com> Comments: In-reply-to Euler Taveira de Oliveira message dated "Wed, 21 Sep 2011 17:13:36 -0300" Date: Wed, 21 Sep 2011 16:31:51 -0400 Message-ID: <28648.1316637111@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/143 X-Sequence-Number: 31160 Euler Taveira de Oliveira writes: > On 21-09-2011 13:38, Robert Haas wrote: >> The rules for interpreting time zone specifications are arcane enough >> to make me suspect that this isn't a bug even though it seems rather >> odd, but in any case it would be useful to know how many hours >> PostgreSQL's timestamp is behind (or ahead of) UTC and similarly for >> the operating system. > I think the OP is talking about one of these timezones: It's a bit premature to speculate without knowing his exact timezone setting, but there seem at least three possibilities: 1. The system clock is, in fact, set wrong, so that the OS is delivering the wrong UTC time to Postgres. This being on a Windows platform, I wouldn't write that off. It would be a good idea to do SET TIMEZONE = UTC; and then see if now() reports the correct UTC time. 2. The timezone setting he's using is inappropriate for the jurisdiction he's in, so that Postgres is following the wrong DST rule. Not knowing either his actual setting or his precise jurisdiction, this is hard to guess about. 3. The zone data that Postgres has is obsolete for his zone. This seems entirely possible, although a look at the git logs doesn't reveal any changes in Central American zone rules since 9.0.1 was released. (I see a change in Mexican rules listed for tzdata release 2010j in May 2010, but that was in 9.0 beta2 and later.) A relevant question here is whether his jurisdiction has observed DST in recent years and then changed their laws. regards, tom lane