Re: timetz need more bytes than timestamptz

Поиск
Список
Период
Сортировка
Искать
От
Junwang Zhao
Тема
Re: timetz need more bytes than timestamptz
Дата
Msg-id
CAEG8a3KOQqdJX8Zn4mszh=pvt2nYpgS1e73+zROV_COJ+q0Yrw@mail.gmail.com
Ответ на
Список
Дерево обсуждения
timetz need more bytes than timestamptz jian he <jian.universality@gmail.com>
Re: timetz need more bytes than timestamptz Junwang Zhao <zhjwpku@gmail.com>
timetz stores only the time units within a day, it uses an extra field
to store the zone info.

typedef int64 TimeADT;
typedef struct
{
    TimeADT time; /* all time units other than months and years */
    int32 zone; /* numeric time zone, in seconds */
} TimeTzADT;

timestamp is a count that starts on January 1st, 1970 at UTC.

You can convert a timestamp to any timezone, but not timetz.

On Mon, Jun 19, 2023 at 11:53 AM jian he  wrote:
>
>
> Hi,
> https://www.postgresql.org/docs/current/datatype-datetime.html
> timetz, timestamptz:
> same resolution.
> fractional digits in the seconds field are also the same.
> >
> > All timezone-aware dates and times are stored internally in UTC. They are converted to local time in the zone specified by the TimeZone configuration parameter before being displayed to the client.
>
> Why does timetz need more bytes (8 vs 12) than timestamptz?



-- 
Regards
Junwang Zhao


В списке pgsql-general по дате отправления
От: Thomas Markus
Дата:
От: Wen Yi
Дата:
FAQ