Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id E93DF9F9B1C for ; Mon, 17 Sep 2007 09:13:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 78365-02 for ; Mon, 17 Sep 2007 09:13:46 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from cerberus.lfix.co.uk (lfix.demon.co.uk [80.177.205.209]) by postgresql.org (Postfix) with ESMTP id C47499F9D2A for ; Mon, 17 Sep 2007 09:13:46 -0300 (ADT) Received: from [192.168.8.1] by cerberus.lfix.co.uk with esmtp (Exim 4.63) (envelope-from ) id 1IXFTr-0004Th-E9 for pgsql-sql@postgresql.org; Mon, 17 Sep 2007 13:13:35 +0100 Subject: Re: Format interval as hours/minutes etc From: Oliver Elphick To: pgsql-sql@postgresql.org In-Reply-To: <46ED5DBF.1030303@Sheeky.Biz> References: <200709161300.53257.andreak@officenet.no> <20070916111427.GA13886@KanotixBox> <200709161327.16989.andreak@officenet.no> <46ED5DBF.1030303@Sheeky.Biz> Content-Type: text/plain Organization: LFIX Date: Mon, 17 Sep 2007 13:13:35 +0100 Message-Id: <1190031215.11172.374.camel@linda.lfix.co.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-LFIX-MailScanner: Found to be clean X-LFIX-MailScanner-From: olly@lfix.co.uk X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/125 X-Sequence-Number: 29338 On Mon, 2007-09-17 at 02:15 +0930, Shane Ambler wrote: > I get the idea you want the interval to be expressed as 2,765 days and > 23 hours or 66,383 hours, which I think would be useful (more so for > shorter intervals). > > I am thinking the exact function you are after isn't there - from what I > can find a larger interval is always given as x years y months z days... > which is why extracting the epoch is the easiest point to start your calcs. > > Maybe this can be a feature request - functions to give an interval in > total number of days/hours/minutes instead of years months days Doesn't the SQL standard allow one to define intervals as YEAR TO MONTH, DAY TO HOUR, HOUR TO SECOND and so on? This sets both the greatest unit to report and the resolution. (YEAR/MONTH cannot be mixed with other types because of the uncertainty of month lengths.) Is there any plan to support that? -- Oliver Elphick olly@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA ======================================== Do you want to know God? http://www.lfix.co.uk/knowing_god.html -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.