Re: [PATCH] Leading minus for negative time interval in ISO 8601

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] Leading minus for negative time interval in ISO 8601
Дата
Msg-id 1193722.1591244705@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCH] Leading minus for negative time interval in ISO 8601  (Chapman Flack <chap@anastigmatix.net>)
Ответы Re: [PATCH] Leading minus for negative time interval in ISO 8601  (Mikhail Titov <mlt@gmx.us>)
Re: [PATCH] Leading minus for negative time interval in ISO 8601  (Mikhail Titov <mlt@gmx.us>)
Список pgsql-hackers
Chapman Flack <chap@anastigmatix.net> writes:
> On 06/03/20 22:46, Tom Lane wrote:
>> "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.

> Umm, did you see any indication that they intend to allow "-" /anywhere/
> in a time interval (with the exception of between year and month, month
> and day in the alternate form, as simple delimiters, not as minus?
> (Maybe you did; I'm looking at a publicly-accessible 2016 draft.)

I don't have an "official" copy either; I was looking at this draft:
https://www.loc.gov/standards/datetime/iso-tc154-wg5_n0038_iso_wd_8601-1_2016-02-16.pdf

I see this bit:

    [±] represents a plus sign [+] if in combination with the following
    element a positive value or zero needs to be represented (in this
    case, unless explicitly stated otherwise, the plus sign shall not be
    omitted), or a minus sign [−] if in combination with the following
    element a negative value needs to be represented.

but I agree that there's no clear application of that to intervals,
either overall or per-field.

> Java durations allow both the PostgreSQL-style minus on individual
> components, and a leading minus that negates the whole thing. [1]
> That explicitly says "The leading plus/minus sign, and negative values
> for other units are not part of the ISO-8601 standard."
> XML Schema (and therefore XML Query, which uses XML Schema data types)
> allows only the leading minus. [2]

Hm.  The slippery slope I *don't* want to be drawn down is somebody
arguing that we should change interval_out, because that would open
a whole Pandora's box of compatibility issues.  Maybe we should just
take the position that negative intervals aren't standardized, and
if you want to transport them using ISO format then you first need
to lobby ISO to fix that.

            regards, tom lane



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Incorrect comment in be-secure-openssl.c
Следующее
От: Mikhail Titov
Дата:
Сообщение: Re: [PATCH] Leading minus for negative time interval in ISO 8601