Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d442t-0005VZ-78 for pgsql-bugs@arkaria.postgresql.org; Fri, 28 Apr 2017 11:26:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d442s-0000Af-Pz for pgsql-bugs@arkaria.postgresql.org; Fri, 28 Apr 2017 11:26:42 +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 1d43QN-0001ZW-8h for pgsql-bugs@postgresql.org; Fri, 28 Apr 2017 10:46:55 +0000 Received: from formauri.es ([78.47.205.180]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d43QJ-0008Te-BD for pgsql-bugs@postgresql.org; Fri, 28 Apr 2017 10:46:54 +0000 Received: from [0.0.0.0] (formauri.es [78.47.205.180]) by formauri.es (Postfix) with ESMTPS id 85627836F0; Fri, 28 Apr 2017 12:46:49 +0200 (CEST) Message-ID: <59031D98.5010008@personal.formauri.es> Date: Fri, 28 Apr 2017 12:46:48 +0200 From: Pedro Gimeno User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Icedove/24.7.0 MIME-Version: 1.0 To: Pietro Pugni CC: pgsql-bugs@postgresql.org Subject: Re: BUG #14632: Plus and minus operators inconsistency with leap years and year intervals. References: <20170426182322.24371.95224@wrigleys.postgresql.org> <5752C491-B0EC-4D1E-AF97-5E1C8C793A8A@gmail.com> <59024CC9.6050109@personal.formauri.es> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Pietro Pugni wrote, On 2017-04-28 10:28: > I’m aware that 2. and 4. can’t return different result because they are the same queries, but in that cases the result correctness depends on the context. You can use 10*interval '31556952 seconds' to add or subtract 10 years with consistent results. 31556952 seconds is the average length of the year in the Gregorian calendar. To use this approach, you need to start using timestamp instead of date, and avoid using timestamp with time zone on a time zone that uses daylight savings. I don't think PostgreSQL needs to do anything about this issue. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs