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 D07879DCCB7 for ; Wed, 1 Mar 2006 19:12:27 -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 30934-01 for ; Wed, 1 Mar 2006 19:12:30 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from candle.pha.pa.us (candle.pha.pa.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id 79E899DCC7F for ; Wed, 1 Mar 2006 19:12:25 -0400 (AST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id k21NBvX06405; Wed, 1 Mar 2006 18:11:57 -0500 (EST) From: Bruce Momjian Message-Id: <200603012311.k21NBvX06405@candle.pha.pa.us> Subject: Re: [SQL] Interval subtracting In-Reply-To: <16750.1141254462@sss.pgh.pa.us> To: Tom Lane Date: Wed, 1 Mar 2006 18:11:57 -0500 (EST) CC: Mark Dilger , pgsql-hackers@postgresql.org X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.415 required=5 tests=[AWL=-0.085, RAZOR2_CHECK=0.5] X-Spam-Score: 0.415 X-Spam-Level: X-Archive-Number: 200603/81 X-Sequence-Number: 80479 Tom Lane wrote: > Bruce Momjian writes: > > Tom Lane wrote: > >> Based on that, I guess I have to change my vote: justify_hours should > >> still not look at the month (because it shouldn't use the month=30days > >> assumption), but justify_days should be changed to be effectively a > >> combination of both functions --- that is, it should fix all three > >> fields using both the 30days and the 24hours assumptions. Then it could > >> guarantee that all come out with the same sign. > > > If we do that, we should just call it justify_interval(). I am thinking > > this is the direction to go, and for people who want more control they > > use the justify_hours and justify_days, and those are left unchanged. > > Well, the question is whether justify_days has a sane definition that is > different from this. Based on your example, I'm not seeing one. Uh, justify days only deals with days <--> months conversions. There is no processing for hours. I don't understand your comment. -- Bruce Momjian http://candle.pha.pa.us SRA OSS, Inc. http://www.sraoss.com + If your life is a hard drive, Christ can be your backup. +