Re: PG is in different timezone than the OS

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Fernando Hevia" <fhevia(at)ip-tel(dot)com(dot)ar>
Cc: "SQL Postgresql List" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: PG is in different timezone than the OS
Date: 2008-01-02 20:06:31
Message-ID: dcc563d10801021206m24c23294m49d9855ddd670a73@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

On Jan 2, 2008 12:43 PM, Fernando Hevia <fhevia(at)ip-tel(dot)com(dot)ar> wrote:
> Hi all,
>
> I am not sure if this is the correct list to post this issue. Please let me
> know if there is a more suitable one.
>
> Argentina's government has recently decreted a timezone change for the
> summer (daylight's savings) where local time zone changes from GMT-3 to
> GMT-2. The Argentinean Summer Timezone is named "ARST".

Well, you're going to have an issue until the timezone databases get
updated, then postgresql gets updated.

The problem is that with date math you need to know when things change
from one offset to another. I.e. ARST is not going to be a constant
offset. It will change based on what date it is, right? If so, then
simply setting the offset to -03:00:00 isn't going to fix your
problem.

Assuming you're on 8.2.x, you can look at the timezones available with
these queries:

select * from pg_timezone_abbrevs;
select * from pg_timezone_names;

If one looks in pg_timezone_names one can find these entries:

America/Argentina/La_Rioja | ART | -03:00:00 | f
America/Argentina/Buenos_Aires | ART | -03:00:00 | f
America/Argentina/San_Juan | ART | -03:00:00 | f
America/Argentina/Mendoza | ART | -03:00:00 | f

and so on. There is no ARST in the database for 8.2.5 that I know of.

select * from pg_timezone_names where utc_offset =
'-02:00:00'::interval and is_dst is true;
name | abbrev | utc_offset | is_dst
--------------------------+--------+------------+--------
America/Sao_Paulo | BRST | -02:00:00 | t
America/Montevideo | UYST | -02:00:00 | t
Brazil/East | BRST | -02:00:00 | t
... CUT for brevity

shows a few timezones that are -0200 and have dst, which means that
they'll go to -0300 in the spring. If the dates they change are the
same as yours, you could use one of them. Try setting your timezone
to one of those and see if the offset changes on the right date.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2008-01-02 20:18:08 Re: Argentinian timezone change at the last moment. How to change pgsql tz db?
Previous Message Erik Jones 2008-01-02 19:04:22 Re: Fwd: [ADMIN] Shutting down warm standby server? "

Browse pgsql-sql by date

  From Date Subject
Next Message Scott Marlowe 2008-01-02 20:18:08 Re: Argentinian timezone change at the last moment. How to change pgsql tz db?
Previous Message Fernando Hevia 2008-01-02 18:43:42 PG is in different timezone than the OS