Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 87FE59FB21B for ; Mon, 2 Oct 2006 18:30:37 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 09688-03 for ; Mon, 2 Oct 2006 21:30:25 +0000 (UTC) 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 6947B9FA0EF for ; Mon, 2 Oct 2006 18:30:25 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k92LTqLJ015326; Mon, 2 Oct 2006 17:29:52 -0400 (EDT) To: "A. R. Van Hook" cc: General Postgresql List Subject: Re: Time interval sums In-reply-to: <45217D8D.7060106@lake-lotawana.mo.us> References: <45217D8D.7060106@lake-lotawana.mo.us> Comments: In-reply-to "A. R. Van Hook" message dated "Mon, 02 Oct 2006 15:58:53 -0500" Date: Mon, 02 Oct 2006 17:29:52 -0400 Message-ID: <15325.1159824592@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200610/8 X-Sequence-Number: 26397 "A. R. Van Hook" writes: > How does one sum interval sums? > the following does not work: > select sum(stop-start::interval) as total from startstop Define "does not work"? What did you get, what were you hoping for? Personally I'd drop the unnecessary cast, but AFAICS there are appropriate operators at least as far back as 7.3. regards, tom lane