Re: Daylight savings time confusion - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Daylight savings time confusion
Date
Msg-id 20100316151159.GD3037@alvh.no-ip.org
Whole thread Raw
In response to Re: Daylight savings time confusion  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:

> If my guesses are correct, then the minimum change to avoid this type
> of problem in the future is to change UTCTimestamp to be declared as
> timestamp WITHOUT time zone, so that you don't get two extra zone
> rotations in there.  However, I would strongly suggest that you rethink
> how you're storing the data altogether.  Two columns that represent the
> identical item of information is not good database design according to
> any theory I've ever heard.  What I'd store is a single fire_date column
> that is of type timestamp with time zone and is just assigned directly
> from current_timestamp without any funny business.  Internally it is UTC
> and completely unambiguous.  Subsequently you can read it out in any
> time zone you want, either by setting TimeZone appropriately or by using
> the AT TIME ZONE construct to do a one-time conversion.

And possibly store the original timezone as a separate column, if that
information is of any value.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-general by date:

Previous
From: Arnaud Lesauvage
Date:
Subject: Re: UPDATE with JOIN not using index
Next
From: Manlio Perillo
Date:
Subject: Re: restoring a database to its initial state