X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 15B615281B for ; Thu, 19 May 2005 17:56:16 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 82452-06 for ; Thu, 19 May 2005 20:56:05 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 2E3A752828 for ; Thu, 19 May 2005 17:56:04 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j4JKuB5Z030152 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 19 May 2005 14:56:14 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j4JKuBbb092553; Thu, 19 May 2005 14:56:11 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j4JKuBGW092552; Thu, 19 May 2005 14:56:11 -0600 (MDT) (envelope-from mfuhr) Date: Thu, 19 May 2005 14:56:11 -0600 From: Michael Fuhr To: Mark Fenbers Cc: pgsql-sql@postgresql.org Subject: Re: Aggregate Functions Template Message-ID: <20050519205611.GA92458@winnie.fuhr.org> References: <428CE633.50403@noaa.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <428CE633.50403@noaa.gov> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/164 X-Sequence-Number: 21477 On Thu, May 19, 2005 at 03:17:07PM -0400, Mark Fenbers wrote: > > I need to create an aggregate function to do some math not currently > provided by the available tools. Can someone point to an example > aggregate function syntax that I can use as a template for my own > function. I'm still a little green on some aspects of PostgreSQL and am > drawing a blank on how to do this properly from scratch. The General Bits newsletter has a few examples that might be helpful, even if they're not quite what you're after: http://www.varlena.com/varlena/GeneralBits/109.php http://www.varlena.com/varlena/GeneralBits/4.html There are sure to be some examples in the list archives -- just search for "create aggregate": http://archives.postgresql.org/ If these links don't help, then please post more details about what you're trying to do and what trouble you're having. If you have any code that doesn't work the way you want but that helps show what you're after, then go ahead and post it with an explanation of what it does (or doesn't do) and what you'd like it to do (or not do). -- Michael Fuhr http://www.fuhr.org/~mfuhr/