Re: BUG #18470: Time literal accepted in Postgres 15 and below, not accepted in Postgres 16 - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #18470: Time literal accepted in Postgres 15 and below, not accepted in Postgres 16
Date
Msg-id 2393945.1715956655@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #18470: Time literal accepted in Postgres 15 and below, not accepted in Postgres 16  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: BUG #18470: Time literal accepted in Postgres 15 and below, not accepted in Postgres 16
List pgsql-bugs
Alvaro Herrera <alvherre@alvh.no-ip.org> 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



pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BUG #18470: Time literal accepted in Postgres 15 and below, not accepted in Postgres 16
Next
From: PG Bug reporting form
Date:
Subject: BUG #18472: SELECT FOR UPDATE locking more rows than expected