Unix Technical Forum

Re: Argentinian timezone change at the last moment. How to change pgsql tz db?

This is a discussion on Re: Argentinian timezone change at the last moment. How to change pgsql tz db? within the pgsql Sql forums, part of the PostgreSQL category; --> Wow! I just looked this up on the web, and all I can say is, this was a really ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Sql

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 06:00 PM
Scott Marlowe
 
Posts: n/a
Default Re: Argentinian timezone change at the last moment. How to change pgsql tz db?

Wow! I just looked this up on the web, and all I can say is, this was
a really stupid idea on the part of the govt in Argentina. It
takes more than a couple days to create new timezone files and deploy
them normally.

I've been reading up on zic and wondering if it's a reasonable thing
to try and update the pg tz db to include the new argentinian DST
change. Where is the tz info stored in postgres? In the catalog?
I'd be willing to take a whack at making a new tz file for argentina
if I knew where it was and how to change it.

(scuttles off to look at the 8.2.5 source)

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 06:00 PM
Joe
 
Posts: n/a
Default Re: Argentinian timezone change at the last moment. How tochange pgsql tz db?

Scott Marlowe wrote:
> I've been reading up on zic and wondering if it's a reasonable thing
> to try and update the pg tz db to include the new argentinian DST
> change. Where is the tz info stored in postgres? In the catalog?
>

Typically in /usr/share/postgresql/timezone or maybe
/usr/local/share/postgresql/timezone.

Joe

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 06:00 PM
Scott Marlowe
 
Posts: n/a
Default Re: Argentinian timezone change at the last moment. How to change pgsql tz db?

On Jan 2, 2008 2:49 PM, Joe <dev@freedomcircle.net> wrote:
> Scott Marlowe wrote:
> > I've been reading up on zic and wondering if it's a reasonable thing
> > to try and update the pg tz db to include the new argentinian DST
> > change. Where is the tz info stored in postgres? In the catalog?
> >

> Typically in /usr/share/postgresql/timezone or maybe
> /usr/local/share/postgresql/timezone.


That doesn't get me what I need. It lets me change the alias of
timezones, but not the start and stop of daylight savings time. I
think for that I'd have to edit / replace the files in
postgresql-8.2.x/src/timezone/data/ and recompile to fix this.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-19-2008, 06:00 PM
Tom Lane
 
Posts: n/a
Default Re: Argentinian timezone change at the last moment. How to change pgsql tz db?

"Scott Marlowe" <scott.marlowe@gmail.com> writes:
> That doesn't get me what I need. It lets me change the alias of
> timezones, but not the start and stop of daylight savings time. I
> think for that I'd have to edit / replace the files in
> postgresql-8.2.x/src/timezone/data/ and recompile to fix this.


Since the OP has apparently already managed to get updated tzdata files
installed on his system, he could just copy them into
/usr/share/postgresql/timezone --- anything using zic should be a
compatible file format.

The lack-of-ARST-on-input problem can be addressed by mucking with
/usr/share/postgresql/timezonesets/Default, if you're using 8.2.
In earlier versions the table is hardwired into datetime.c :-(

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-19-2008, 06:00 PM
Fernando Hevia
 
Posts: n/a
Default Re: Argentinian timezone change at the last moment. How to change pgsql tz db?



> Tom Lane wrote:
>
> "Scott Marlowe" <scott.marlowe@gmail.com> writes:
> > That doesn't get me what I need. It lets me change the alias of
> > timezones, but not the start and stop of daylight savings time. I
> > think for that I'd have to edit / replace the files in
> > postgresql-8.2.x/src/timezone/data/ and recompile to fix this.

>
> Since the OP has apparently already managed to get updated tzdata files
> installed on his system, he could just copy them into
> /usr/share/postgresql/timezone --- anything using zic should be a
> compatible file format.
>
> The lack-of-ARST-on-input problem can be addressed by mucking with
> /usr/share/postgresql/timezonesets/Default, if you're using 8.2.
> In earlier versions the table is hardwired into datetime.c :-(
>
> regards, tom lane


Thanks Scott and Tom for your help on this.

After copying the updated tz file to /usr/share/postgresql/timezone Postgres
got aware of the time change.

Regarding the ARST recognition, I'm still on 8.1.9.
An upgrade seems urgent now.

Regards,
Fernando.


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-19-2008, 06:00 PM
Fernando Hevia
 
Posts: n/a
Default Re: Argentinian timezone change at the last moment. How to change pgsql tz db?



> Tom Lane [mailto:tgl@sss.pgh.pa.us] wrote:
>
> Since the OP has apparently already managed to get updated tzdata files
> installed on his system, he could just copy them into
> /usr/share/postgresql/timezone --- anything using zic should be a
> compatible file format.
>
> The lack-of-ARST-on-input problem can be addressed by mucking with
> /usr/share/postgresql/timezonesets/Default, if you're using 8.2.
> In earlier versions the table is hardwired into datetime.c :-(
>


Summing up:

After installing the updated tzdata files in the server I had to copy the
America/Argentina/* files to /usr/share/postgresql/timezone in order to get
postgres determine the correct local time.

With 8.2.x the ARST abbreviation was recognized after including the
following line in /usr/share/postgresql/8.2/timezonesets/Default

ARST -14400 D # Argentina Summer Time

postgres=# select '01:13:16.426 ARST Wed Jan 2 2008'::timestamp with time
zone;
timestamptz
----------------------------
2008-01-02 01:13:16.426-02
(1 row)

I wonder if pg_timezone_names plays any role in the ARST issue. It does
contain the right data (appeared after copying tzdata into
/usr/share/postgresql/timezone and restarting server) but ARST wasn't
accepted till previous step was done.

postgres=# select * from pg_timezone_names where abbrev = 'ARST';
name | abbrev | utc_offset | is_dst
--------------------------------+--------+------------+--------
localtime | ARST | -02:00:00 | t
America/Argentina/Rio_Gallegos | ARST | -02:00:00 | t
America/Argentina/Mendoza | ARST | -02:00:00 | t
America/Argentina/La_Rioja | ARST | -02:00:00 | t
America/Argentina/Buenos_Aires | ARST | -02:00:00 | t
America/Argentina/Cordoba | ARST | -02:00:00 | t
America/Argentina/Catamarca | ARST | -02:00:00 | t
America/Argentina/Ushuaia | ARST | -02:00:00 | t
America/Argentina/Tucuman | ARST | -02:00:00 | t
America/Argentina/Jujuy | ARST | -02:00:00 | t
America/Argentina/San_Juan | ARST | -02:00:00 | t
(11 rows)


Thanks for all contributions.

Regards,
Fernando.




---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:15 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com