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

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: Pietro Pugni <pietro(dot)pugni(at)gmail(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "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 23:08:32
Message-ID: CAL9smLD5ARjoWon=YgJCXKD-Dc9cCPXOhNRQYxu_J-4ivPeuPw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Apr 27, 2017 at 1:01 AM, Pietro Pugni <pietro(dot)pugni(at)gmail(dot)com>
wrote:

> Expect 1912-02-28 is a correct response. The only reason you think the
> 29th comes into play here is because you remember that the starting point
> was the 29th. The system has no such memory.
>
> And this is logically wrong because it leads to wrong results. I’m aware
> that time intervals are difficult to manage but more exactness is needed
> here: '10 years' must have the same meaning when added to a date and
> subtracted from it, otherwise it leads to wrong results.
>

Your suggestion just moves the wrong results to another use case; see my
response upthread. There is no objectively correct answer here, like you
seem to think.

.m

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2017-04-26 23:12:30 Re: Concurrent ALTER SEQUENCE RESTART Regression
Previous Message David G. Johnston 2017-04-26 23:05:27 Re: BUG #14632: Plus and minus operators inconsistency with leap years and year intervals.