Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 374E62E0047 for ; Tue, 13 May 2008 03:20:20 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 29251-02 for ; Tue, 13 May 2008 03:20:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from vilnius.balt.net (vilnius.balt.net [195.14.170.14]) by developer.postgresql.org (Postfix) with ESMTP id 461992E0040 for ; Tue, 13 May 2008 03:20:14 -0300 (ADT) Received: from nSoft.lt (unknown [217.117.29.29]) by vilnius.balt.net (Postfix) with ESMTP id B07173956C2 for ; Tue, 13 May 2008 09:20:11 +0300 (EEST) Received: from [192.168.16.4] (unknown [192.168.16.4]) by nSoft.lt (Postfix) with ESMTP id 1789BBF2FE for ; Tue, 13 May 2008 10:01:43 +0000 (GMT) Message-ID: <48293319.2000201@nsoft.lt> Date: Tue, 13 May 2008 09:20:09 +0300 From: Julius Tuskenis User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 CC: pgsql-admin@postgresql.org Subject: Re: how to get a number of seconds in some interval ? References: <482849B0.6050103@nsoft.lt> <200805121724.38772.achill@matrix.gatewaynet.com> <48285507.4010007@nsoft.lt> <200805121801.35101.achill@matrix.gatewaynet.com> <20080.1210604951@sss.pgh.pa.us> In-Reply-To: <20080.1210604951@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.961 tagged_above=0 required=5 tests=AWL=-0.620, MISSING_HEADERS=1.581 X-Spam-Level: X-Archive-Number: 200805/100 X-Sequence-Number: 29184 Thank you, it's now clear to me. Tom Lane rašė: > Achilleas Mantzios writes: > >> Στις Monday 12 May 2008 17:32:39 ο/η Julius Tuskenis έγραψε: >> >>> do you know why division of intervals was not implemented? As I see it - >>> there should be an easy way to do so. '1 hour 30 minutes' / '1 hour' = >>> 1.5 .... Seems straight forward... >>> >>> >> No idea why. However as you pose it,it makes sense. >> > > No, it doesn't really, because intervals contain multiple components. > What would you define as the result of > '1 month 1 hour' / '1 day' > bearing in mind that the number of days per month is not fixed, and > neither is the number of hours per day? > > You can derive a number if you're willing to make arbitrary assumptions > about the relationships of the different units (as indeed extract(epoch) > does), but hard-wiring such assumptions into a basic arithmetic operator > doesn't seem like a good idea to me. > > regards, tom lane > > -- Julius Tuskenis Programavimo skyriaus vadovas UAB nSoft mob. +37068233050