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

Поиск
Список
Период
Сортировка
От Yann Salaün
Тема Re: [NOVICE] Does pg store all `timestamp with time zone` inlocaltime? Why?
Дата
Msg-id CAHDVCz7RQwEp9o6KdtKCuyfuLLsWnh=h1t1gKH_B2EeHK+T1JQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [NOVICE] Does pg store all `timestamp with time zone` inlocaltime? Why?  (Greg Robson <gregrobson@gmail.com>)
Список pgsql-novice
Thank you Greg for this exciting read.

On Thu, Aug 24, 2017 at 8:07 PM, Greg Robson <gregrobson@gmail.com> wrote:
Threre's a really good explanation of the data type, it's implementation, usage and how to insert/select values:

(This was one of those "this is why I love Postgres" moments!)

On 24 August 2017 at 14:00, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
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


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


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

Предыдущее
От: Greg Robson
Дата:
Сообщение: Re: [NOVICE] Does pg store all `timestamp with time zone` inlocaltime? Why?
Следующее
От: Dipesh Dangol
Дата:
Сообщение: [NOVICE] connection breakdown issue in postgresql while using replication slotwith the help of stream api java