Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id D387D2E0048 for ; Mon, 12 May 2008 12:09:35 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 65409-03 for ; Mon, 12 May 2008 12:09:19 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id CED842E003A for ; Mon, 12 May 2008 12:09:19 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m4CF9C0X020081; Mon, 12 May 2008 11:09:12 -0400 (EDT) To: Achilleas Mantzios cc: Julius Tuskenis , pgsql-admin@postgresql.org Subject: Re: how to get a number of seconds in some interval ? In-reply-to: <200805121801.35101.achill@matrix.gatewaynet.com> References: <482849B0.6050103@nsoft.lt> <200805121724.38772.achill@matrix.gatewaynet.com> <48285507.4010007@nsoft.lt> <200805121801.35101.achill@matrix.gatewaynet.com> Comments: In-reply-to Achilleas Mantzios message dated "Mon, 12 May 2008 18:01:34 +0300" Date: Mon, 12 May 2008 11:09:11 -0400 Message-ID: <20080.1210604951@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/95 X-Sequence-Number: 29179 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