Re: [NOVICE] Does pg store all `timestamp with time zone` inlocaltime? Why?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: [NOVICE] Does pg store all `timestamp with time zone` inlocaltime? Why?
Дата
Msg-id 20170824130002.6233jmyy6wqjchjg@alvherre.pgsql
обсуждение исходный текст
Ответ на [NOVICE] Does pg store all `timestamp with time zone` in localtime? Why?  (Yann Salaün <yannsalaun1@gmail.com>)
Ответы Re: [NOVICE] Does pg store all `timestamp with time zone` inlocaltime? Why?  (Greg Robson <gregrobson@gmail.com>)
Список pgsql-novice
Yann Salaün wrote:
> Hello,
>
> I was surprised to observe this behavior in psql (my time zone is GMT+2)

No, it stores in UTC and converts back and forth as you store then in
and as you read them out.  It depends on the TimeZone configuration
parameter each time.  The TZ that was current when the value was stored,
is itself NOT stored in the same column.  You could add a column to
store that TZ, if you wanted.

--
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


В списке pgsql-novice по дате отправления:

Предыдущее
От: Yann Salaün
Дата:
Сообщение: [NOVICE] Does pg store all `timestamp with time zone` in localtime? Why?
Следующее
От: kakalo
Дата:
Сообщение: [NOVICE] Restore backup file