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 ACCDD9DC821 for ; Wed, 1 Mar 2006 19:50:50 -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 34577-10 for ; Wed, 1 Mar 2006 19:50:53 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.markdilger.com (or-65-40-225-74.sta.sprint-hsd.net [65.40.225.74]) by postgresql.org (Postfix) with ESMTP id 5CA0A9DC809 for ; Wed, 1 Mar 2006 19:50:47 -0400 (AST) Received: from [192.168.2.6] ([192.168.2.6]) (TLS: TLSv1/SSLv3,256bits,AES256-SHA) by mail.markdilger.com with esmtp; Wed, 01 Mar 2006 15:55:40 -0800 id 00020D65.4406347D.0000414F Message-ID: <4406331A.6080307@markdilger.com> Date: Wed, 01 Mar 2006 15:49:46 -0800 From: Mark Dilger User-Agent: Mozilla Thunderbird 1.0 (X11/20050130) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruce Momjian CC: Tom Lane , pgsql-hackers@postgresql.org Subject: Re: [SQL] Interval subtracting References: <200603012326.k21NQOv08610@candle.pha.pa.us> In-Reply-To: <200603012326.k21NQOv08610@candle.pha.pa.us> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.096 required=5 tests=[AWL=0.096] X-Spam-Score: 0.096 X-Spam-Level: X-Archive-Number: 200603/87 X-Sequence-Number: 80485 Bruce Momjian wrote: > Even if we had people do: > > justify_hours(justify_days(justify_hours())) > > I don't think that would do what we want in all cases. Consider '1 mon > -1 hour'. That should be '29 days 23 hours' but neither existing > function, even if modified, will allow us to return that. Only > something like justify_interval() could do it. > 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. There is no need for justify_interval(...), except as syntactic sugar. Since the backward compatibility argument didn't convince you, then we should go with the existing patch as-is. Whether we introduce the new function justify_interval(...) could be treated as a separate question, though I don't mind putting that in the patch and resubmitting. mark