public inbox for [email protected]
help / color / mirror / Atom feedFrom: Joseph Koshakow <[email protected]>
To: Tom Lane <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: [email protected]
Subject: Re: Date-Time dangling unit fix
Date: Sat, 4 Mar 2023 18:31:36 -0500
Message-ID: <CAAvxfHcr0ibhcoxPg7LLDXDwTmcjKimk+53vH3_Lzgwxb4LfFQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAAvxfHf2Q1gKLiHGnuPOiyf0ASvKUM4BnMfsXuwgtYEb_Gx0Zw@mail.gmail.com>
<CAAvxfHf++UNBoYua8AQkwM3MCpLszOBeug-2F9PjD79mrW5SDA@mail.gmail.com>
<CAAvxfHc8xy42wX8Xk7RTLee_O16ui4RfT7vkjfnN+ERgpaHV+g@mail.gmail.com>
<CAAvxfHdRsz=KRbp=gFvbOzVfcX1UoDxCzj8BwAYKMt46Hi+eAw@mail.gmail.com>
<[email protected]>
On Sat, Mar 4, 2023 at 4:05 PM Tom Lane <[email protected]> wrote:
>
> I started to look at this, and soon noticed that while we have test
cases
> matching this sort of date input, there is no documentation for it.
The
> code claims it's an "ISO" (presumably ISO 8601) format, and maybe it is
> because it looks a lot like the ISO 8601 format for intervals
(durations).
> But I don't have a copy of ISO 8601, and some googling fails to find
any
> indication that anybody else believes this is a valid datetime format.
> Wikipedia for example documents a lot of variants of ISO 8601 [1],
> but nothing that looks like this.
>
> I wonder if we should just rip this code out instead of fixing it.
> I suspect its real-world usage is not different from zero. We'd
> have to keep the "Jnnn" Julian-date case, though, so maybe there's
> little to be saved.
>
> If we do keep it, there's documentation work to be done. But the
> first bit of doco I'd want to see is a pointer to a standard.
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 CC'ed Thomas in
case the email still exists and they happen to remember. The commit
message mentions ISO, but not the variant mentioned in the comment.
The mailing list thread can be found here [2], but it doesn't provide
much more information. I also found the following thread [3], which
happens to have you in it in case you remember it, which seemed to be
the motivation for commit [1]. It only contains the following line
about ISO:
> o support for "ISO variants" on input, including embedded "T" preceeding
the time fields
All that seems to imply the "y2001m02d04" ISO variant was never really
discussed in much detail and it's probably fine to remove it. Though,
it has been around for 22 years which makes it a bit scary to remove.
- Joe Koshakow
[1]
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=6f58115dddfa8ca63004c4784f57ef6604228...
[2]
https://www.postgresql.org/message-id/flat/3BB433D5.3CB4164E%40fourpalms.org
[3]
https://www.postgresql.org/message-id/flat/3B970FF8.B9990807%40fourpalms.org#c57d83c80d295bfa19887c9...
view thread (2+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Date-Time dangling unit fix
In-Reply-To: <CAAvxfHcr0ibhcoxPg7LLDXDwTmcjKimk+53vH3_Lzgwxb4LfFQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox