Re: INTERVAL output format for iso_8601 is without dashes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: benjamin(dot)kroeger(at)gmail(dot)com
Cc: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: INTERVAL output format for iso_8601 is without dashes
Date: 2026-03-15 20:14:23
Message-ID: 2120277.1773605663@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-docs

PG Doc comments form <noreply(at)postgresql(dot)org> writes:
> https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-INTERVAL-OUTPUT
> The output format for mixed Interval in style specification iso_8601 is
> documented incorrectly.
> The documentation says `P-1Y-2M3D​T-4H-5M-6S` while in reality there are no
> dashes: `P1Y2M3D​T4H5M6S`

It looks correct to me:

regression=# set intervalstyle TO iso_8601;
SET
regression=# select '-1 year -2 mons +3 days -04:05:06'::interval;
interval
---------------------
P-1Y-2M3DT-4H-5M-6S
(1 row)

regards, tom lane

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Benjamin Kröger 2026-03-16 11:39:32 Re: INTERVAL output format for iso_8601 is without dashes
Previous Message Laurenz Albe 2026-03-12 19:56:00 Re: Clarifying pg_rewind failure risks due to asynchronous file deletions