From: Tom Lane <tgl@sss.pgh.pa.us>
To: marek.lall@eesti.ee
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17240: <timestamptz> at time zone ... ; wrong result
Date: Mon, 25 Oct 2021 12:25:54 -0400
Message-ID: <4046745.1635179154@sss.pgh.pa.us> (raw)
In-Reply-To: <CADDPzFTa7ipw157Ep7rx2a=grWN71xsfXA4-=X31LzGEuv4_fA@mail.gmail.com>
References: <17240-cdccc24b9eee2d2c@postgresql.org>
<2402843.1634823660@sss.pgh.pa.us>
<CADDPzFTa7ipw157Ep7rx2a=grWN71xsfXA4-=X31LzGEuv4_fA@mail.gmail.com>
=?UTF-8?Q?Marek_L=C3=A4ll?= <lall.marek@gmail.com> writes:
> POSIX string (syntax) is defined as:
> --> stdoffset[dst[offset][,start-date[/time],end-date[/time]]]
> The std string specifies the name of the time zone.
> It must be three or more characters long and must not contain a leading
> colon, embedded digits, commas, nor plus and minus signs.
Hmm, you're reading the POSIX spec I guess, because our docs don't
say that ;-). The IANA tzdb code only enforces that STD not be empty,
and Postgres has modified it to allow empty STD as well. That's
an ancient backwards-compatibility decision that we likely ought
to change sometime, so I've intentionally not documented it in
appendix B.5 [1]. The text in B.5 actually says that you need angle
brackets if you want any non-letters in STD or DST, which is more
conservative than what the IANA code will accept.
> 2) then: ignores the fact that string '-07:00' is invalid POSIX value
It's valid according to our interpretation of POSIX. Some experimentation
suggests that GNU date(1) enforces the POSIX definition exactly, which is
that STD be at least three characters, all alphabetic. That implies that
they wrote their own TZ parser, because the IANA reference code doesn't
act that way.
regards, tom lane
[1] https://www.postgresql.org/docs/current/datetime-posix-timezone-specs.html
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, marek.lall@eesti.ee, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17240: <timestamptz> at time zone ... ; wrong result
In-Reply-To: <4046745.1635179154@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox