Re: BUG #14632: Plus and minus operators inconsistency with leap years and year intervals.

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14632: Plus and minus operators inconsistency with leap years and year intervals.
Date: 2017-04-26 20:56:20
Message-ID: CAKFQuwaoQLk4TBTjO1Mz8F3V+=z5UCG6116mOHjdGS0B_C7BOg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Apr 26, 2017 at 1:53 PM, John R Pierce <pierce(at)hogranch(dot)com> wrote:

> On 4/26/2017 1:30 PM, Pietro Pugni wrote:
>
> Adding 10 years to 1912-02-29 returns 1922-02-29, as expected.
> I would like to apply the *reverse* operation. To do so, I subtract 10
> years from 1922-02-29 but I obtain 1912-02-28, so *the math is actually
> wrong*.
>
>
> assuming 1922 was a leap year, 1912 is NOT a leap year, so therefore there
> is no 1912-02-29, that is an invalid date.
>

​PostgreSQL think 1912 is the leap year, 1922 is not...

Dave

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Marko Tiikkaja 2017-04-26 21:06:50 Re: BUG #14632: Plus and minus operators inconsistency with leap years and year intervals.
Previous Message John R Pierce 2017-04-26 20:53:10 Re: BUG #14632: Plus and minus operators inconsistency with leap years and year intervals.