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

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

On 2024-May-17, PG Bug reporting form wrote:

> I've read carefully this documentation:
> https://www.postgresql.org/docs/current/datatype-datetime.html
>
> It states that:
>
> ISO 8601 specifies the use of uppercase letter T to separate the date and
> time. PostgreSQL accepts that format on input, but on output it uses a space
> rather than T, as shown above. This is for readability and for consistency
> with RFC 3339 as well as some other database systems

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."

https://git.postgresql.org/cgit/postgresql.git/commit/?id=5b3c5953553bb9fb0b171abc6041e7c7e9ca5b4d

There's no test case modified in this commit that specified only a time
with no date, so assume this particular change was unintentional.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"Most hackers will be perfectly comfortable conceptualizing users as entropy
sources, so let's move on." (Nathaniel Smith)
https://mail.gnu.org/archive/html/monotone-devel/2007-01/msg00080.html

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2024-05-17 14:37:35 Re: BUG #18470: Time literal accepted in Postgres 15 and below, not accepted in Postgres 16
Previous Message PG Bug reporting form 2024-05-17 13:13:06 BUG #18471: Possible JIT memory leak resulting in signal 11: Segmentation fault on ARM