X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id A10E89DC9CB for ; Wed, 14 Dec 2005 15:09:12 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 57572-10-2 for ; Wed, 14 Dec 2005 15:09:11 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from wolff.to (wolff.to [66.93.197.194]) by postgresql.org (Postfix) with SMTP id 5B4269DC9B1 for ; Wed, 14 Dec 2005 15:09:08 -0400 (AST) Received: (qmail 1650 invoked by uid 500); 14 Dec 2005 19:13:57 -0000 Date: Wed, 14 Dec 2005 13:13:57 -0600 From: Bruno Wolff III To: "Marc G. Fournier" Cc: pgsql-sql@postgresql.org Subject: Re: # of 5 minute intervals in period of time ... Message-ID: <20051214191357.GA32563@wolff.to> Mail-Followup-To: Bruno Wolff III , "Marc G. Fournier" , pgsql-sql@postgresql.org References: <20051213183044.X1070@ganymede.hub.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051213183044.X1070@ganymede.hub.org> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.015 required=5 tests=[AWL=0.015] X-Spam-Score: 0.015 X-Spam-Level: X-Archive-Number: 200512/125 X-Sequence-Number: 23667 On Tue, Dec 13, 2005 at 18:34:36 -0400, "Marc G. Fournier" wrote: > > Is there a simpler way of doing this then: > > select (date_part('epoch', now()) - > date_part('epoch', now() - '30 days'::interval)) / ( 5 * 60 ); Are you trying to do this: select extract(epoch from '30 days'::interval) / 300; The above works in 8.0, but I don't know for sure what it does in 8.1. Probably it just treats days as 24 hours, similar to how months are treated as having 30 days. > > ---- > Marc G. Fournier Hub.Org Networking Services (http://www.hub.org) > Email: scrappy@hub.org Yahoo!: yscrappy ICQ: 7615664 > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings