Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 5C3AC930E1E for ; Fri, 3 Aug 2012 14:26:05 -0300 (ADT) Received: from fep14.mx.upcmail.net ([62.179.121.34]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SxLdT-0006G0-V2 for pgsql-admin@postgresql.org; Fri, 03 Aug 2012 17:26:04 +0000 Received: from edge03.upcmail.net ([192.168.13.238]) by viefep14-int.chello.at (InterMail vM.8.01.05.04 201-2260-151-105-20111014) with ESMTP id <20120803172550.PPZG12297.viefep14-int.chello.at@edge03.upcmail.net>; Fri, 3 Aug 2012 19:25:50 +0200 Received: from [192.168.0.101] ([89.134.225.226]) by edge03.upcmail.net with edge id iHRp1j01D4tiMtV03HRptW; Fri, 03 Aug 2012 19:25:50 +0200 X-SourceIP: 89.134.225.226 Message-ID: <501C099C.6060904@shopzeus.com> Date: Fri, 03 Aug 2012 19:25:48 +0200 From: Laszlo Nagy User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Tom Lane , pgsql-admin@postgresql.org Subject: Re: Messed up time zones 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> In-Reply-To: <19252.1344011891@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/29 X-Sequence-Number: 39850 2012.08.03. 18:38 keltezéssel, Tom Lane írta: > Laszlo Nagy 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. :-)