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 8C3B59DC856 for ; Sat, 18 Feb 2006 10:24:21 -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 68763-04 for ; Sat, 18 Feb 2006 10:24:24 -0400 (AST) X-Greylist: delayed 23:55:41.688813 by SQLgrey- Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by postgresql.org (Postfix) with ESMTP id BB6319DC84C for ; Sat, 18 Feb 2006 10:24:15 -0400 (AST) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FAT0V-0004Bo-Bd for pgsql-sql@postgresql.org; Sat, 18 Feb 2006 15:24:19 +0100 Received: from 85.187.136.11 ([85.187.136.11]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Feb 2006 15:24:19 +0100 Received: from milen by 85.187.136.11 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Feb 2006 15:24:19 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: "Milen A. Radev" Subject: Re: Interval subtracting Date: Sat, 18 Feb 2006 16:24:39 +0200 Lines: 19 Message-ID: <43F72E27.2060408@radev.net> References: <200602181444.06009.milorad.poluga@cores.co.yu> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 85.187.136.11 User-Agent: Mozilla Thunderbird 1.5 (Windows/20051201) In-Reply-To: <200602181444.06009.milorad.poluga@cores.co.yu> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.373 required=5 tests=[AWL=0.120, RCVD_NUMERIC_HELO=1.253] X-Spam-Score: 1.373 X-Spam-Level: * X-Archive-Number: 200602/235 X-Sequence-Number: 24245 Milorad Poluga написа: > Hi all, > > Is there something incorrect in the above query ? > SELECT '10 years 1 mons 1 days'::interval - '9 years 10 mons 15 days'::interval > > ?column? > --------------- > 3 mons -14 days > > Why not '2 mons 16 days' ? > > /version = PostgreSQL 8.0.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) / How many days are there in a month? -- Milen A. Radev