Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 3D7572E0080 for ; Tue, 13 May 2008 11:36:28 -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 19404-02-4 for ; Tue, 13 May 2008 11:36:10 -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 2576F2E0176 for ; Tue, 13 May 2008 11:15:35 -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 m4DEFR1j024657; Tue, 13 May 2008 10:15:27 -0400 (EDT) To: Achilleas Mantzios cc: pgsql-admin@postgresql.org, Julius Tuskenis Subject: Re: how to get a number of seconds in some interval ? In-reply-to: <200805130956.51872.achill@matrix.gatewaynet.com> References: <482849B0.6050103@nsoft.lt> <200805121801.35101.achill@matrix.gatewaynet.com> <20080.1210604951@sss.pgh.pa.us> <200805130956.51872.achill@matrix.gatewaynet.com> Comments: In-reply-to Achilleas Mantzios message dated "Tue, 13 May 2008 09:56:50 +0300" Date: Tue, 13 May 2008 10:15:27 -0400 Message-ID: <24656.1210688127@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/109 X-Sequence-Number: 29193 Achilleas Mantzios writes: > So it seems that the arbitary assumption of (1 month=30 days, and 1 day = 24 hours) has already been made in the extract function. Right, as I said: >> 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), The point is that we don't want to propagate that bogus assumption further than we have to. EXTRACT() already implies loss of information, so it's reasonable for it to deliver a simplified view of reality, but it doesn't follow that division should. regards, tom lane