X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 765CDD1B53C for ; Sun, 19 Oct 2003 21:00:41 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 62700-01 for ; Sun, 19 Oct 2003 18:00:11 -0300 (ADT) Received: from mx3.absolight.com (mx3.absolight.net [212.43.217.9]) by svr1.postgresql.org (Postfix) with ESMTP id 2C1A1D1B4E4 for ; Sun, 19 Oct 2003 18:00:09 -0300 (ADT) Received: by mx3.absolight.com (Postfix, from userid 1007) id E10432A04; Sun, 19 Oct 2003 23:00:09 +0200 (CEST) X-Original-To: pgsql-sql@postgresql.org Received: from sauron.in.mat.cc (sauron.in.mat.cc [212.43.217.122]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx3.absolight.com (Postfix) with ESMTP id 7FC2E29E8; Sun, 19 Oct 2003 23:00:08 +0200 (CEST) Date: Sun, 19 Oct 2003 23:00:03 +0200 From: Mathieu Arnold To: email lists , pgsql-sql@postgresql.org Subject: Re: date_trunc for 5 minutes intervals Message-ID: <614747984.1066604403@sauron.in.mat.cc> In-Reply-To: <035C9F7CE28601428BBB5B051C9F77F20766F4@orion.mackay.local> References: <035C9F7CE28601428BBB5B051C9F77F20766F4@orion.mackay.local> X-Mailer: Mulberry/3.1.0b8 (Win32) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/326 X-Sequence-Number: 15726 +-Le 19/10/2003 23:38 +1000, email lists =E9crivait : | Hi All, |=20 | I am wanting to perform the equivalent of date_trunc to 5/10/15 minute | intervals. As this does mnot seem to be natively supported by | date_trunc, can anyone point me in the right direction to possible write | the SQL ro achieve the desired outcome? maybe (date_part(epoch, field)::integer / 300 * 300)::timetamp for 5 minutes interval... --=20 Mathieu Arnold