Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3TwJ-0006ub-Re for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Apr 2017 20:53:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d3TwJ-0000Ra-Dg for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Apr 2017 20:53:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d3TwJ-0000RM-33 for pgsql-bugs@postgresql.org; Wed, 26 Apr 2017 20:53:31 +0000 Received: from hogranch.com ([75.101.82.47]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3TwB-0002hz-7x for pgsql-bugs@postgresql.org; Wed, 26 Apr 2017 20:53:30 +0000 Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id v3QKrDi25205 for ; Wed, 26 Apr 2017 13:53:13 -0700 Subject: Re: BUG #14632: Plus and minus operators inconsistency with leap years and year intervals. To: pgsql-bugs@postgresql.org References: <20170426182322.24371.95224@wrigleys.postgresql.org> <5752C491-B0EC-4D1E-AF97-5E1C8C793A8A@gmail.com> From: John R Pierce Message-ID: <5f3b0581-8c2d-8323-73c7-e917da54c96c@hogranch.com> Date: Wed, 26 Apr 2017 13:53:10 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: <5752C491-B0EC-4D1E-AF97-5E1C8C793A8A@gmail.com> Content-Type: multipart/alternative; boundary="------------E76BB1C96DFFF51B9DAA880B" Content-Language: en-US X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org This is a multi-part message in MIME format. --------------E76BB1C96DFFF51B9DAA880B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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. -- john r pierce, recycling bits in santa cruz --------------E76BB1C96DFFF51B9DAA880B Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
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.



-- 
john r pierce, recycling bits in santa cruz
--------------E76BB1C96DFFF51B9DAA880B--