Re: timestamptz, local time in the future, and Don't do it wiki - Mailing list pgsql-general

From Peter J. Holzer
Subject Re: timestamptz, local time in the future, and Don't do it wiki
Date
Msg-id 20230127180346.pn3gbwaajr2cckg4@hjp.at
Whole thread Raw
In response to timestamptz, local time in the future, and Don't do it wiki  (Max Nikulin <manikulin@gmail.com>)
Responses Re: timestamptz, local time in the future, and Don't do it wiki
List 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!"

Attachment

pgsql-general by date:

Previous
From: Rob Sargent
Date:
Subject: Re: Sequence vs UUID
Next
From: Rumpi Gravenstein
Date:
Subject: Indexes mysteriously change to LOG