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

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: david(dot)perez(dot)ingeniero(at)gmail(dot)com
Subject: BUG #18470: Time literal accepted in Postgres 15 and below, not accepted in Postgres 16
Date: 2024-05-17 11:04:53
Message-ID: 18470-34fad4c829106848@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 18470
Logged by: david perez
Email address: david(dot)perez(dot)ingeniero(at)gmail(dot)com
PostgreSQL version: 16.3
Operating system: Linux
Description:

This is the result with Postgres 16:

postgres=# select VERSION();
version

---------------------------------------------------------------------------------------------------------------------
PostgreSQL 16.3 (Debian 16.3-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled
by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
(1 row)

postgres=# select 'T14:00:00'::time;
ERROR: invalid input syntax for type time: "T14:00:00"
LINE 1: select 'T14:00:00'::time;

And this is the result with Postgres 15:

postgres=# select VERSION();
version

---------------------------------------------------------------------------------------------------------------------
PostgreSQL 15.7 (Debian 15.7-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled
by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
(1 row)

postgres=# select 'T14:00:00'::time;
time
----------
14:00:00
(1 row)

A time literal that begins with the letter "T" isn't accepted anymore.

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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next 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
Previous Message Retno Utami 2024-05-17 09:17:55 Issues in finding libeay.dll and ssleay.dll for win x64