pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Laszlo Nagy <gandalf@shopzeus.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Messed up time zones
Date: Fri, 03 Aug 2012 12:38:11 -0400
Message-ID: <19252.1344011891@sss.pgh.pa.us> (raw)
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>

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.

> 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



view thread (17+ messages)  latest in thread

Message-ID: <19252.1344011891@sss.pgh.pa.us>
Permalink:  ../19252.1344011891@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19252.1344011891@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, gandalf@shopzeus.com, pgsql-admin@postgresql.org
  Subject: Re: Messed up time zones
  In-Reply-To: <19252.1344011891@sss.pgh.pa.us>

* 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