Re: Date-Time dangling unit fix

Alexander Law <exclusion@gmail.com>

From: Alexander Lakhin <exclusion@gmail.com>
To: Joseph Koshakow <koshy44@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, lockhart@fourpalms.org
Date: 2023-03-05T14:00:01Z
Lists: pgsql-hackers
Hello,

05.03.2023 02:31, Joseph Koshakow wrote:
> I also don't have a copy of ISO 8601 and wasn't able to find anything
> about this variant on Google. I did find this comment in datetime.c
>
> /*
> * Was this an "ISO date" with embedded field labels? An
> * example is "y2001m02d04" - thomas 2001-02-04
> */
>
> which comes from this commit [1], which was authored by Thomas Lockhart
> (presumably the same thomas from the comment).

I've also seen another interesting comment in datetime.c:
                 /*
                  * Was this an "ISO time" with embedded field labels? An
                  * example is "h04mm05s06" - thomas 2001-02-04
                  */
In fact,
SELECT time 'h04mm05s06';
doesn't work for many years, but
SELECT time 'h04mm05s06.0';
still does.

I've just found that I mentioned it some time ago:
https://www.postgresql.org/message-id/dff75442-2468-f74f-568c-6006e141062f%40gmail.com

Best regards,
Alexander

Commits

  1. Tighten error checks in datetime input, and remove bogus "ISO" format.

  2. Measure the current transaction time to milliseconds.