pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laszlo Nagy <gandalf@shopzeus.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-admin@postgresql.org
Subject: Re: Messed up time zones
Date: Fri, 03 Aug 2012 19:25:48 +0200
Message-ID: <501C099C.6060904@shopzeus.com> (raw)
In-Reply-To: <19252.1344011891@sss.pgh.pa.us>
References: <501B8C6F.6040100@shopzeus.com>
	<501BAA84.9010306@shopzeus.com>
	<501BAE33.4090102@shopzeus.com>
	<16399.1344003584@sss.pgh.pa.us>
	<501BED07.5070603@shopzeus.com>
	<501BEF7C.1030403@dhs-club.com>
	<501BF70E.4090903@shopzeus.com>
	<19252.1344011891@sss.pgh.pa.us>

2012.08.03. 18:38 keltezéssel, Tom Lane írta:
> Laszlo Nagy <gandalf@shopzeus.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. :-)




view thread (17+ messages)  latest in thread

Message-ID: <501C099C.6060904@shopzeus.com>
Permalink:  ../501C099C.6060904@shopzeus.com/
Also on:    postgresql.org/message-id/501C099C.6060904@shopzeus.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: gandalf@shopzeus.com, tgl@sss.pgh.pa.us, pgsql-admin@postgresql.org
  Subject: Re: Messed up time zones
  In-Reply-To: <501C099C.6060904@shopzeus.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox