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 06EC09DC839 for ; Wed, 1 Mar 2006 18:46:19 -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 25644-07 for ; Wed, 1 Mar 2006 18:46:21 -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 D91D79DC809 for ; Wed, 1 Mar 2006 18:46:16 -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 k21MjldR016570; Wed, 1 Mar 2006 17:45:47 -0500 (EST) To: Bruce Momjian cc: Mark Dilger , pgsql-hackers@postgresql.org Subject: Re: [SQL] Interval subtracting In-reply-to: <200603012145.k21LjRX11928@candle.pha.pa.us> References: <200603012145.k21LjRX11928@candle.pha.pa.us> Comments: In-reply-to Bruce Momjian message dated "Wed, 01 Mar 2006 16:45:27 -0500" Date: Wed, 01 Mar 2006 17:45:47 -0500 Message-ID: <16569.1141253147@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/75 X-Sequence-Number: 80473 Bruce Momjian writes: > Imagine this: > '1 mons -2 days -12:00:00' > Which sign do we head to for this? For justify_hours, if we don't look > at the months it remains unchange, but calling justify_days we get: > '28 days -12:00:00' > which is wrong (negative and positive). Ugh, that's not good. 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. regards, tom lane