Re: timestamptz, local time in the future, and Don't do it wiki

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: timestamptz, local time in the future, and Don't do it wiki
Дата
Msg-id 20230127180346.pn3gbwaajr2cckg4@hjp.at
обсуждение исходный текст
Ответ на timestamptz, local time in the future, and Don't do it wiki  (Max Nikulin <manikulin@gmail.com>)
Ответы Re: timestamptz, local time in the future, and Don't do it wiki  (Max Nikulin <manikulin@gmail.com>)
Список pgsql-general
On 2023-01-27 19:12:08 +0700, Max Nikulin wrote:
> I am unsure what is the proper mailing list to discuss an the issue,
> this one or pgsql-doc.
>
> PostgreSQL has a reputation of software with excellent support of time
> zones, so some people take recommendation to use "timestamp with time zone"
> type excessively literally. I mean the "Don't do this" page in the wiki:
> https://wiki.postgresql.org/wiki/Don%27t_Do_This#Date.2FTime_storage
>
> Could you, please, add a case when the timestamptz type should not be used?
> UTC timestamps of forthcoming events may change due to an updates of tzdata
> if they really scheduled at specific local time. An example:

Yes. I could argue that this isn't really a "timestamp", though. The
time when the future event will happen isn't fixed yet - it depends on
future decisions (e.g. an update to DST rules or even a complete switch
to a different time zone).

However, few people will be that picky in their terminology. So it's
probably a good idea to point out that times which are supposed to be
relative to a specific time zone should be stored as local time + time
zone, not timestamptz (the time zone can be implicit).

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Вложения

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

Предыдущее
От: Rob Sargent
Дата:
Сообщение: Re: Sequence vs UUID
Следующее
От: Rumpi Gravenstein
Дата:
Сообщение: Indexes mysteriously change to LOG