Re: BUG #17240: <timestamptz> at time zone ... ; wrong result

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: marek(dot)lall(at)eesti(dot)ee
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17240: <timestamptz> at time zone ... ; wrong result
Date: 2021-10-25 16:25:54
Message-ID: 4046745.1635179154@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

=?UTF-8?Q?Marek_L=C3=A4ll?= <lall(dot)marek(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Thomas Munro 2021-10-25 20:49:09 Re: BUG #17245: Index corruption involving deduplicated entries
Previous Message Peter Geoghegan 2021-10-25 15:29:11 Re: ERROR: posting list tuple with 20 items cannot be split at offset 168