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

From: Roman Frołow <rofrol(at)gmail(dot)com>
To: Erik Wienhold <ewie(at)ewie(dot)name>
Cc: 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-13 11:03:09
Message-ID: CAFZ1f-9rnK6uZwsUUKDwCkNB9h9zP70oaSfduu+TxrQAxEmwjQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

So what should be changed?

postgresql docs say that it is consistent with rfc3339 using space.

Also look at this:

> In addition, an uppercase "T" character MUST be used to separate date and
time

https://validator.w3.org/feed/docs/error/InvalidRFC3339Date.html

I would say that postgresql is not consistent with rfc3339, but rather
with ISO8601 which is very flexible in regard to separator etc.

On Mon, Nov 13, 2023 at 11:23 AM Erik Wienhold <ewie(at)ewie(dot)name> wrote:

> On 2023-11-11 23:45 +0100, PG Doc comments form wrote:
> > The following documentation comment has been logged on the website:
> >
> > Page: https://www.postgresql.org/docs/16/git.html
> > Description:
> >
> > >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.
>
> This note probably refers to section 5.6. of RFC 3339 [1] which allows
> applications to choose space over "T".
>
> > https://www.postgresql.org/docs/current/datatype-datetime.html
> >
> > Short answer: T (or t as discouraged alternative).
> >
> > After reading on this as much as I could, it turns out the time separator
> > must be a T or t. What has made think this way is first of all this
> thread
> > in the GNU lists where F. Alexander Njemz contacted the authors of
> RFC3339
> > Graham Klyne and Chris Newman asking if T is mandatory and got this
> response
> > from Mr. Klyne:
> >
> > > In short: "yes"
> > >
> > > Per section 5.5, the intent in this draft was to specify a timestamp
> > format using elements from and compatible with 8601, but eliminating as
> far
> > as reasonable any variations that could make timestamp data harder to
> > process. This includes making the 'T' mandatory in date+time values.
> >
> > Just for clarity's sake, this is stated in the section 5.5:
> >
> > > Simplicity is achieved by making most fields and punctuation mandatory.
>
> But the word "most" certainly leaves some wiggle room.
>
> > This clearly clashes with a non-mandatory T and strongly makes me think
> that
> > the this syntax in that problematic passage refers to ISO8601 and not
> > RFC3339.
> >
> >
> https://stackoverflow.com/questions/63783868/what-are-valid-date-time-separators-in-rfc3339-strings/63882162#63882162
>
> [1] https://datatracker.ietf.org/doc/html/rfc3339#section-5.6
>
> --
> Erik
>

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Alvaro Herrera 2023-11-13 11:20:15 Re: add new acronym "AM"
Previous Message Daniel Gustafsson 2023-11-13 11:00:20 Re: add new acronym "AM"