Re: Inconsistency of timezones in postgresql - Mailing list pgsql-bugs

From Aleksander Alekseev
Subject Re: Inconsistency of timezones in postgresql
Date
Msg-id CAJ7c6TMJJR0ubWxcNG_KhzfE1Q2JUHeWFezgcWUUO=B7KRHjVQ@mail.gmail.com
Whole thread Raw
In response to Re: Inconsistency of timezones in postgresql  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Hi,

> I think this is a documentation issue, specifically that Section 8.5.3
> is not sufficiently in-your-face about "UTC+2" not meaning what you
> probably think.  We didn't really do anybody any favors by shoving
> those details off to Appendix B.

IMO the warning should be placed closer to the documentation for AT
TIME ZONE where users have more chances to find it. Here is the patch.

The paragraph:

"""
In addition to the timezone names and abbreviations, PostgreSQL will
accept POSIX-style time zone specifications, as described in Section
B.5. This option is not normally preferable [...]
"""

... of section 8.5.3 looks reasonably well written to me and it gives
the reference to the corresponding section about POSIX rules. We could
additionally clarify this section with the following examples:

```
-- works as most users would expect
SELECT TIMESTAMPTZ '2024-08-01 13:06:20+3' AT TIME ZONE 'UTC';
Result: 2024-08-01 10:06:20

-- applies POSIX rules
SELECT TIMESTAMPTZ '2024-08-01 13:06:20 UTC-3' AT TIME ZONE 'UTC';
Result: 2024-08-01 10:06:20
```

However personally I believe it's redundant. In my humble experience
people typically prefer shorter syntax as in the first example and we
already said that we don't recommend using POSIX-style time zones. The
reason why it's important in case of AT TIME ZONE is because both '+3'
and 'UTC+3' are interpreted by POSIX rules.

-- 
Best regards,
Aleksander Alekseev

Attachment

pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Inconsistency of timezones in postgresql
Next
From: PG Bug reporting form
Date:
Subject: BUG #18562: pg_upgrade (14.12 -> 15.7/16.3) fails when schema has unlogged table with logged sequence