=?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