X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 2BB0A9DC992 for ; Wed, 8 Mar 2006 17:22:36 -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 73326-10 for ; Wed, 8 Mar 2006 17:22:37 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from peufeu.com (boutiquenumerique.com [82.67.9.10]) by postgresql.org (Postfix) with ESMTP id A23189DC8AC for ; Wed, 8 Mar 2006 17:22:32 -0400 (AST) Received: (qmail 9971 invoked from network); 8 Mar 2006 22:23:06 +0100 Received: from boutiquenumerique.com (HELO apollo13) (82.67.9.10) by boutiquenumerique.com with SMTP; 8 Mar 2006 22:23:06 +0100 Date: Wed, 08 Mar 2006 22:23:05 +0100 To: pgsql-sql@postgresql.org Subject: Re: [HACKERS] Interval subtracting References: <200603012027.k21KRk423759@candle.pha.pa.us> <1141245396.18820.16.camel@state.g2switchworks.com> <440EC8FF.9080201@logix-tt.com> <1141832866.6249.7.camel@state.g2switchworks.com> From: PFC Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: In-Reply-To: <1141832866.6249.7.camel@state.g2switchworks.com> User-Agent: Opera M2/8.51 (Linux, build 1462) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.103 required=5 tests=[AWL=0.103] X-Spam-Score: 0.103 X-Spam-Level: X-Archive-Number: 200603/126 X-Sequence-Number: 24472 > For same reasons, i.e. a need for precision, I find it hard to accept > the idea of mixing positive and negative units in the same interval. > The plus or minus sign should be outside of the interval. The interval data type is really useful. I see no reason to restrict its usefulness with an arbitrary constraint. Date arithmetic is treacherous and INTERVAL is a lifesaver. Forcing a global sign on the interval would break interval arithmetic. How would you compute '1 month'::interval - '1 week'::interval ?