Re: Daylight savings time confusion

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Daylight savings time confusion
Дата
Msg-id 20100316151159.GD3037@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Daylight savings time confusion  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Arnaud Lesauvage
Дата:
Сообщение: Re: UPDATE with JOIN not using index
Следующее
От: Manlio Perillo
Дата:
Сообщение: Re: restoring a database to its initial state