Re: [BUGS] BUG #14632: Plus and minus operators inconsistency withleap years and year intervals. - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: [BUGS] BUG #14632: Plus and minus operators inconsistency withleap years and year intervals.
Date
Msg-id CAKFQuwZ+PXKFrQ+LqOOorfva9nMesie0WQpe_hJTdkMn7vCZAw@mail.gmail.com
Whole thread Raw
In response to [BUGS] BUG #14632: Plus and minus operators inconsistency with leap yearsand year intervals.  (pietro.pugni@gmail.com)
Responses Re: [BUGS] BUG #14632: Plus and minus operators inconsistency with leap years and year intervals.
List pgsql-bugs
On Wed, Apr 26, 2017 at 11:23 AM, <pietro.pugni@gmail.com> wrote:
The following bug has been logged on the website:

Bug reference:      14632
Logged by:          Pietro Pugni
Email address:      pietro.pugni@gmail.com
PostgreSQL version: 9.6.2
Operating system:   Ubuntu 16.04.2 LTS
Description:

The following query:
 SELECT '1912-02-29'::date + '10 years'::interval

returns:
 '1922-02-28 00:00:00'

while the reverse operation:
 SELECT '1922-02-28'::date - '10 years'::interval

returns:
 '1912-02-28 00:00:00'

instead of '1912-02-29 00:00:00'.

​What part of this do you consider to be a bug - and what should it do instead?

David J.​

pgsql-bugs by date:

Previous
From: pietro.pugni@gmail.com
Date:
Subject: [BUGS] BUG #14632: Plus and minus operators inconsistency with leap yearsand year intervals.
Next
From: Martin
Date:
Subject: [BUGS] Re: AfterTriggerSaveEvent() Error on altered foreign key cascadeddelete