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

From: Mikhail Titov <mlt(at)gmx(dot)us>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: [PATCH] Leading minus for negative time interval in ISO 8601
Date: 2020-06-03 21:31:44
Message-ID: 9q0367bkf9b.fsf@gmx.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello!

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. However, lots of
software use leading minus and expect/generate intervals in such forms
making those incompatible with current PostgreSQL decoding code.

All patch is doing is making a note of a leading minus and negates pg_tm
components along with fractional seconds. No other behavior change is
introduced.

--
Mikhail

Attachment Content-Type Size
0001-Support-leading-minus-in-front-of-ISO-8601-interval-.patch text/x-patch 1.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2020-06-03 21:40:31 Re: Atomic operations within spinlocks
Previous Message Andres Freund 2020-06-03 20:45:42 Re: Atomic operations within spinlocks