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 0B0F29DC9A4 for ; Wed, 1 Mar 2006 17:11:46 -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 94096-03 for ; Wed, 1 Mar 2006 17:11:43 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 8795A9DC98B for ; Wed, 1 Mar 2006 17:11:40 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k21LB9Fk015321; Wed, 1 Mar 2006 16:11:09 -0500 (EST) To: Mark Dilger cc: Bruce Momjian , pgsql-hackers@postgresql.org Subject: Re: [SQL] Interval subtracting In-reply-to: <44060C42.50905@markdilger.com> References: <200603012013.k21KDFM21139@candle.pha.pa.us> <14834.1141244891@sss.pgh.pa.us> <44060682.9020505@markdilger.com> <15150.1141246521@sss.pgh.pa.us> <44060C42.50905@markdilger.com> Comments: In-reply-to Mark Dilger message dated "Wed, 01 Mar 2006 13:04:02 -0800" Date: Wed, 01 Mar 2006 16:11:09 -0500 Message-ID: <15320.1141247469@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.111 required=5 tests=[AWL=0.111] X-Spam-Score: 0.111 X-Spam-Level: X-Archive-Number: 200603/63 X-Sequence-Number: 80461 Mark Dilger writes: > The current code (without the patch) behaves as follows: > select justify_days(justify_hours('1 month 95 days -36:00:00'::interval)); > justify_days > ------------------------- > 4 mons 4 days -12:00:00 So? If we liked the current behavior we wouldn't be discussing a patch... My thought is that justify_hours should reduce that input to '1 month 93 days 12:00:00' and then justify_days would produce '4 months 3 days 12:00:00'. regards, tom lane