It seems in the definition of ISO 8601 (RFC-3339), it wrotes: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A
Durations:
dur-second = 1*DIGIT "S"
dur-minute = 1*DIGIT "M" [dur-second]
dur-hour = 1*DIGIT "H" [dur-minute]
dur-time = "T" (dur-hour / dur-minute / dur-second)
dur-day = 1*DIGIT "D"
dur-week = 1*DIGIT "W"
dur-month = 1*DIGIT "M" [dur-day]
dur-year = 1*DIGIT "Y" [dur-month]
dur-date = (dur-day / dur-month / dur-year) [dur-time]
Note that the unit letter here is upper case, while jiff's Display prints lower case.
It would fail when using format("{}", dur) to cast the repr to a PostgreSQL's Interval: https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-INTERVAL-INPUT
... where only upper case letters are accepted:
scopedb_meta=# SELECT INTERVAL 'PT10m';
ERROR: invalid input syntax for type interval: "PT10m"
LINE 1: SELECT INTERVAL 'PT10m';
^
scopedb_meta=# SELECT INTERVAL 'PT10M';
interval
----------
00:10:00
(1 row)
I'm not sure if it's intended or if somewhere there only accepts lower case letters. But the described PG interval integration is a failed case I encountered.
It seems in the definition of ISO 8601 (RFC-3339), it wrotes: https://datatracker.ietf.org/doc/html/rfc3339#appendix-A
Note that the unit letter here is upper case, while jiff's Display prints lower case.
It would fail when using
format("{}", dur)to cast the repr to a PostgreSQL's Interval: https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-INTERVAL-INPUT... where only upper case letters are accepted:
I'm not sure if it's intended or if somewhere there only accepts lower case letters. But the described PG interval integration is a failed case I encountered.