Postgresql datetimes are not ISO-8601 compliant, but RFC3339

Поиск
Список
Период
Сортировка
От Leon Timmermans
Тема Postgresql datetimes are not ISO-8601 compliant, but RFC3339
Дата
Msg-id CAHhgV8hKWA8JtWEqzhAj-eA9TenG-iu620ZsaxJnFAYMiE6A2A@mail.gmail.com
обсуждение исходный текст
Ответы Re: Postgresql datetimes are not ISO-8601 compliant, but RFC3339  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs
Postgresql calls its datetime format ISO-8601 in the documentation and in the DateStyle setting, but it is in fact not ISO compliant, but RFC3339 instead. To quote the latter (which is freely available unlike the ISO standard):

  NOTE: ISO 8601 defines date and time separated by "T".
      Applications using this syntax may choose, for the sake of
      readability, to specify a full-date and full-time separated by
      (say) a space character.

Basically instead of outputting «2022-02-12 02:53:59.55718+01», it should output «2022-02-12T02:53:59.55718+01» to be compliant. Fortunately it will accept compliant datetimes as input just fine. I ran into this because I was feeding these values into a strict ISO-8601 implementation and it rejected these values.

The solution that I would suggest for the next major release is to add a new RFC DateStyle with the current behavior and make the ISO setting do the conformant thing; and on existing release series add RFC as an alias of ISO to facilitate the transition for people who may rely on the current behavior.

Regards,

Leon

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Troy Frericks
Дата:
Сообщение: A bug with the TimeStampTZ data type and the 'AT TIME ZONE' clause
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Postgresql datetimes are not ISO-8601 compliant, but RFC3339