Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachment: signature.asc
Description: PGP signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux