how do you write aggregate function

From: Justin <justin(at)emproshunts(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: how do you write aggregate function
Date: 2008-03-04 16:44:34
Message-ID: 47CD7C72.2010604@emproshunts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The help is not real clear nor can i find examples how to write an
aggregate function.

I searched the archive of the mail list and did not find anything

I need to write Weighted Average function so the need to keep track of
multiple variables between function calls is must?

I see how the /|sfunc|/( internal-state, next-data-values ) keeps
track of the passed values with the internal state. Can the internal
state be an array type where i just adding new entries to a
multi-dimensional array then on ffunc do all the math in.

One person pointed out the pl/r plugin but what i'm working on gets tied
into the PostBooks/OpenMfg project and they are not real big fans on
adding another language and plugin they have to make sure their
customers have deployed (which i'm one of those customers).

PostBooks/OpenMfg will want all the functions in pl/pgsql does this
present any major problems??

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Colin Wetherbee 2008-03-04 17:17:23 Re: how do you write aggregate function
Previous Message Douglas McNaught 2008-03-04 15:06:52 Re: Build 8.3 with OpenSSL on CentOS 5.x?