Re: Domain based on TIMEZONE WITH TIME ZONE

Поиск
Список
Период
Сортировка
От Francisco Olarte
Тема Re: Domain based on TIMEZONE WITH TIME ZONE
Дата
Msg-id CA+bJJbz0Gwo8mkyzHa_4qjcNcMV0M00yTZ_LjUtaJu=M=+bpyQ@mail.gmail.com
обсуждение исходный текст
Ответ на Domain based on TIMEZONE WITH TIME ZONE  (Ben Hood <ben@relops.com>)
Ответы Re: Domain based on TIMEZONE WITH TIME ZONE  (Ben Hood <ben@relops.com>)
Список pgsql-general
On Thu, May 10, 2018 at 10:03 AM, Ben Hood <ben@relops.com> wrote:
...
> Am I missing the point of how Postgres stores TIMEZONE WITH TIME ZONE
> internally?

After reading in the follow up TIMEZONE is a typo for TIMESTAMP, yes, you are.

Aproximately, postgres stores ( virtually ) a point in the time line,
for both with and without ts types, same format. Something like a real
number.

The difference is mainly for transforming from/to text ( bear in mind
when you put a constant in a query you are trasnforming from text ).
In the with time zone case it formats/expects it as a time string in
the session configured time zone, in the without case it treats it (
aproximately ) as if it was in utc ( and then discards the "+00" after
formating ).

Maybe I'm confussing you more, its not too easy to explain.

The point is TIMEZONE is not stored in either of them.

Francisco Olarte.


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

Предыдущее
От: Ben Hood
Дата:
Сообщение: Re: Domain based on TIMEZONE WITH TIME ZONE
Следующее
От: Alban Hertroys
Дата:
Сообщение: Re: ON CONFLICT DO UPDATE