Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s7yiM-008ioF-Ow for pgsql-bugs@arkaria.postgresql.org; Fri, 17 May 2024 14:37:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s7yiM-00EUid-Gl for pgsql-bugs@arkaria.postgresql.org; Fri, 17 May 2024 14:37:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s7yiM-00EUiV-8j for pgsql-bugs@lists.postgresql.org; Fri, 17 May 2024 14:37:42 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s7yiI-000j0c-HV for pgsql-bugs@lists.postgresql.org; Fri, 17 May 2024 14:37:41 +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 44HEbZvh2393946; Fri, 17 May 2024 10:37:35 -0400 From: Tom Lane To: Alvaro Herrera cc: david.perez.ingeniero@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18470: Time literal accepted in Postgres 15 and below, not accepted in Postgres 16 In-reply-to: <202405171346.virffgus6cjg@alvherre.pgsql> References: <202405171346.virffgus6cjg@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Fri, 17 May 2024 15:46:45 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2393944.1715956655.1@sss.pgh.pa.us> Date: Fri, 17 May 2024 10:37:35 -0400 Message-ID: <2393945.1715956655@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > Hmm, at least the Wikipedia page claims that the leading T should be > accepted. > https://en.wikipedia.org/wiki/ISO_8601#Times >> postgres=# select 'T14:00:00'::time; >> ERROR: invalid input syntax for type time: "T14:00:00" > This changed with commit 5b3c5953553b, "Tighten error checks in datetime > input, and remove bogus "ISO" format." Thanks, I was just about to go bisect that for myself. My recollection is that that commit meant to remove some formats that we couldn't see any justification for in the ISO 8601 spec. I'm not sure whether that wikipedia page should be taken as authoritative, but if we can convince ourselves that 'T14:00:00' really is a thing per 8601, then yeah we should undo that part. If it's not a thing per the spec, then I'd tend to say "sorry, but this was intentional to reduce the code's propensity to accept garbage". regards, tom lane