Re: T is a mandatory date time separator in RFC3339 but documentation states differently

From: Erik Wienhold <ewie(at)ewie(dot)name>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Roman Frołow <rofrol(at)gmail(dot)com>, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: T is a mandatory date time separator in RFC3339 but documentation states differently
Date: 2023-11-14 18:21:15
Message-ID: d65bzp5h6j2lroyt3y4t7vlth76hdegjuh67dlsmxqzmzjbvtp@fdc4xs5awb3f
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On 2023-11-13 17:23 +0100, Tom Lane wrote:
> Erik Wienhold <ewie(at)ewie(dot)name> writes:
> > On 2023-11-13 15:24 +0100, Erik Wienhold wrote:
> >> I also noticed that when people say "ISO 8601" they usually mean RFC
> >> 3389 or some subset of ISO 8601.
>
> > Forgot this fine visualization of the differences:
> > https://ijmacd.github.io/rfc3339-iso8601/
>
> I'm inclined not to change anything here, for a couple of reasons:
>
> 1. PG accepts a fairly large number of ISO 8601 variants (not all);
> not only the RFC 3339 format. So s/ISO 8601/RFC 3339/g would be
> incorrect.

I did not say that occurrences of "ISO 8601" should be replaced with
"RFC 3339". Just that the docs should have a cautionary note about the
SQL standard using a subset of ISO 8601 and that Postgres does not
implement (at the moment) all of its date formats.

> Besides, I think more people know what ISO 8601 is than
> know what RFC 3339 is, so that change would also be confusing.

Fair point.

> 2. If ijmacd's pretty graphic is correct, then what we say about
> 'T' versus space is correct, even if it isn't the whole truth.
> I'm not quite sure that ijmacd is correct, though, because of
> this bit in 3339:
>
> NOTE: Per [ABNF] and ISO8601, the "T" and "Z" characters in this
> syntax may alternatively be lower case "t" or "z" respectively.
>
> which suggests that 8601 is also case-insensitive. I don't plan
> to go buy a copy of that spec to find out, though.

I dug up my old copies (1988/2000/2004) from uni (let me know if you're
interested ;) Lower case is allowed if upper case is not available.
And it doesn't allow space in any edition. Quote from the 2004 edition:

> 3.4.1 Introduction
>
> NOTE 1 In date and time representations lower case characters may
> be used when upper case characters are not available.
>
> NOTE 2 Encoding of characters for the interchange of dates and times
> is not in the scope of this International Standard.
>
> Unless explicitly allowed by this International Standard the character
> "space" shall not be used in the representations.

Probably still the same in the current edition but I won't pay for that
either.

--
Erik

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Peter Eisentraut 2023-11-15 07:16:04 Re: T is a mandatory date time separator in RFC3339 but documentation states differently
Previous Message Laurenz Albe 2023-11-14 04:21:50 Re: Documentation of return values of range functions lower and upper