From: Bruno Wolff III <bruno@wolff.to>
To: Marc G. Fournier <scrappy@postgresql.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: # of 5 minute intervals in period of time ...
Date: Wed, 14 Dec 2005 13:13:57 -0600
Message-ID: <20051214191357.GA32563@wolff.to> (raw)
In-Reply-To: <20051213183044.X1070@ganymede.hub.org>
References: <20051213183044.X1070@ganymede.hub.org>
On Tue, Dec 13, 2005 at 18:34:36 -0400,
"Marc G. Fournier" <scrappy@postgresql.org> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: bruno@wolff.to, scrappy@postgresql.org
Subject: Re: # of 5 minute intervals in period of time ...
In-Reply-To: <20051214191357.GA32563@wolff.to>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox