Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 93E39930E1E for ; Fri, 3 Aug 2012 13:38:28 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SxKtM-0005NE-Oa for pgsql-admin@postgresql.org; Fri, 03 Aug 2012 16:38:28 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q73GcBvt019253; Fri, 3 Aug 2012 12:38:12 -0400 (EDT) From: Tom Lane To: Laszlo Nagy cc: pgsql-admin@postgresql.org Subject: Re: Messed up time zones In-reply-to: <501BF70E.4090903@shopzeus.com> 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> Comments: In-reply-to Laszlo Nagy message dated "Fri, 03 Aug 2012 18:06:38 +0200" Date: Fri, 03 Aug 2012 12:38:11 -0400 Message-ID: <19252.1344011891@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/28 X-Sequence-Number: 39849 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. > As far as I'm concerned, I'm going to set the system's clock to UTC, > store everything in timestamp field (in UTC), and use a program to > convert fetched values before displaying them. [ shrug... ] If you really insist on re-inventing that wheel, go ahead, but it sounds to me like you'll just be introducing additional points of failure. regards, tom lane