Search Postgresql Archives

Re: Daylight savings time confusion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux