Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mf2nw-0007fA-FW for pgsql-bugs@arkaria.postgresql.org; Mon, 25 Oct 2021 16:26:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mf2nv-0001fy-F3 for pgsql-bugs@arkaria.postgresql.org; Mon, 25 Oct 2021 16:26:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mf2nv-0001fa-7i for pgsql-bugs@lists.postgresql.org; Mon, 25 Oct 2021 16:26:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mf2nn-0003C0-Vw for pgsql-bugs@lists.postgresql.org; Mon, 25 Oct 2021 16:26:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 19PGPsgl4046746; Mon, 25 Oct 2021 12:25:55 -0400 From: Tom Lane To: marek.lall@eesti.ee cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17240: at time zone ... ; wrong result In-reply-to: References: <17240-cdccc24b9eee2d2c@postgresql.org> <2402843.1634823660@sss.pgh.pa.us> Comments: In-reply-to =?UTF-8?Q?Marek_L=C3=A4ll?= message dated "Mon, 25 Oct 2021 10:35:34 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4046744.1635179154.1@sss.pgh.pa.us> Date: Mon, 25 Oct 2021 12:25:54 -0400 Message-ID: <4046745.1635179154@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =?UTF-8?Q?Marek_L=C3=A4ll?= 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