Re: BUG #18470: Time literal accepted in Postgres 15 and below, not accepted in Postgres 16

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: david(dot)perez(dot)ingeniero(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18470: Time literal accepted in Postgres 15 and below, not accepted in Postgres 16
Date: 2024-05-17 14:37:35
Message-ID: 2393945.1715956655@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2024-05-17 15:35:58 BUG #18472: SELECT FOR UPDATE locking more rows than expected
Previous Message Alvaro Herrera 2024-05-17 13:46:45 Re: BUG #18470: Time literal accepted in Postgres 15 and below, not accepted in Postgres 16