Re: Messed up time zones

From: Laszlo Nagy <gandalf(at)shopzeus(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Messed up time zones
Date: 2012-08-03 17:25:48
Message-ID: 501C099C.6060904@shopzeus.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-performance

2012.08.03. 18:38 keltezéssel, Tom Lane írta:
> Laszlo Nagy <gandalf(at)shopzeus(dot)com> writes:
>> I have intentionally chosen an example where the local time is changed
>> from summer time to winter time (e.g. local time suddenly "goes back"
>> one hour). It demonstrates that you cannot use "at time zone ...."
>> expression to convert a timestamptz into a desired time zone manually.
> Um, yes you can. The trick is to use a timezone name, not an
> abbreviation, in the AT TIME ZONE construct (for instance,
> 'Europe/Budapest' not just 'CET'). That will do the rotation
> in a DST-aware fashion.
And loose information at the same time. Because after the conversion,
you won't be able to tell if it is a summer or a winter time. So yes,
you are right. You can do that kind of conversion, but then sometimes
you won't know when it was, or what it means. This problem could be
solved by storing the UTC offset together with the time zone, internally
in PostgreSQL.

Maybe, if that is not a problem for the user, he can use "at time zone"
for converting between time zones. Personally, I will stick with UTC and
use a program to convert values, because I would like to know when it
was. :-)

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Radovan Jablonovsky 2012-08-03 18:08:45 Re: PostgreSQL oom_adj postmaster process to -17
Previous Message Laszlo Nagy 2012-08-03 17:21:08 Re: [ADMIN] Messed up time zones

Browse pgsql-performance by date

  From Date Subject
Next Message Laszlo Nagy 2012-08-03 18:25:32 Re: Messed up time zones
Previous Message Laszlo Nagy 2012-08-03 17:21:08 Re: [ADMIN] Messed up time zones