Re: [PATCH] Leading minus for negative time interval in ISO 8601 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] Leading minus for negative time interval in ISO 8601
Date
Msg-id 1189720.1591238786@sss.pgh.pa.us
Whole thread Raw
In response to [PATCH] Leading minus for negative time interval in ISO 8601  (Mikhail Titov <mlt@gmx.us>)
Responses Re: [PATCH] Leading minus for negative time interval in ISO 8601
Re: [PATCH] Leading minus for negative time interval in ISO 8601
List pgsql-hackers
Mikhail Titov <mlt@gmx.us> writes:
> I'd like to propose a simple patch to allow for negative ISO 8601
> intervals with leading minus, e.g. -PT1H besides PT-1H. It seems that
> standard isn't quite clear on negative duration.

"Isn't quite clear"?  ISTM that if the standard intended to allow that,
it'd be pretty clear.  I looked through the 8601 spec just now, and
I can't see any indication whatever that they intend to allow "-" before P.
It's hard to see why they'd bother with that introducer at all if
data can appear before it.

> However, lots of
> software use leading minus and expect/generate intervals in such forms
> making those incompatible with current PostgreSQL decoding code.

Which "lots of software" are you speaking of, exactly?  interval_in
has never had such a capability, and I don't recall previous complaints
about it.

The difference between a useful standard and a useless one is the
extent to which people obey the standard rather than adding random
extensions to it, so I'm not inclined to add such an extension
without a very well-grounded argument for it.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Parallel copy
Next
From: Thomas Munro
Date:
Subject: Re: libpq copy error handling busted