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>)
Список pgsql-general
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 <jian.universality@gmail.com> 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
specifiedby 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
Дата:
Сообщение: Re: Question: Multiple pg clusters on one server can be reached with the standard port.
Следующее
От: "Wen Yi"
Дата:
Сообщение: [Beginner Question]How to let the lex && yacc parsing the string? Instead of the console.