X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 605ED9DC821 for ; Wed, 1 Mar 2006 20:03:35 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 37928-01 for ; Wed, 1 Mar 2006 20:03:38 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id E3E919DCD13 for ; Wed, 1 Mar 2006 20:03:32 -0400 (AST) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id EA40030C3B; Thu, 2 Mar 2006 01:03:34 +0100 (MET) From: Mark Dilger X-Newsgroups: pgsql.hackers Subject: Re: [SQL] Interval subtracting Date: Wed, 01 Mar 2006 16:02:58 -0800 Organization: Hub.Org Networking Services Lines: 28 Message-ID: <44063632.20505@markdilger.com> References: <200603012326.k21NQOv08610@candle.pha.pa.us> <4406331A.6080307@markdilger.com> <17317.1141257505@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org To: Tom Lane User-Agent: Mozilla Thunderbird 1.0 (X11/20050130) X-Accept-Language: en-us, en In-Reply-To: <17317.1141257505@sss.pgh.pa.us> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime To: pgsql-hackers@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.1 required=5 tests=[AWL=0.100] X-Spam-Score: 0.1 X-Spam-Level: X-Archive-Number: 200603/89 X-Sequence-Number: 80487 Tom Lane wrote: > Mark Dilger writes: > >>justify_days(justify_hours(...)) fixes *everything* in the most recently >>submitted patch, regardless of the convoluted case you invent. There is no data >>for which it won't work. > > > If so, one function or the other is cheating. Per discussion, > justify_hours must never touch months, and I don't believe that > justify_days should touch seconds either. The proposed justify_interval > function should have a result different from successive application > of the two existing functions, because it will ensure that all three > fields have similar signs whereas separate use of the two functions > can't promise that in corner cases. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster > That depends what you mean by cheating. The justify_hours function looks to see what answer justify_days would give, but does not actually change the data. I described this all earlier and I still don't see why there is anything wrong with it. mark