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 420D99DC9B7 for ; Tue, 7 Feb 2006 13:03:13 -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 01889-01 for ; Tue, 7 Feb 2006 13:03:12 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id 262C09DC9CD for ; Tue, 7 Feb 2006 13:03:11 -0400 (AST) Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id EA831421AC9; Tue, 7 Feb 2006 17:03:07 +0000 (GMT) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 9EDE415EA4; Tue, 7 Feb 2006 17:03:07 +0000 (GMT) Message-ID: <43E8D2CB.2050105@archonet.com> Date: Tue, 07 Feb 2006 17:03:07 +0000 From: Richard Huxton User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 To: Panos Kassianidis , pgsql-sql Subject: Re: Filtering data based on timestamp References: <43E8BF73.9000802@inaccessnetworks.com> <43E8C18B.1010206@archonet.com> <43E8D09F.1090401@inaccessnetworks.com> In-Reply-To: <43E8D09F.1090401@inaccessnetworks.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.116 required=5 tests=[AWL=0.116] X-Spam-Score: 0.116 X-Spam-Level: X-Archive-Number: 200602/67 X-Sequence-Number: 24077 Panos Kassianidis wrote: > Thanks very much for the answer. > Could you also please tell me how am I supposed to write such a function? > How is date_trunc implemented so that I can extend it? In C in SQL? I'd probably write it in plpgsql unless you need the speed. > And where can I find its source code? With the source - available from the website. -- Richard Huxton Archonet Ltd