Re: AGREGATE FUNCTIONS - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: AGREGATE FUNCTIONS
Date
Msg-id Pine.OSF.4.61.0606062000210.243169@kosh.hut.fi
Whole thread Raw
In response to AGREGATE FUNCTIONS  (Roberto Rezende de Assis <rezende_assis@yahoo.com.br>)
List pgsql-hackers
On Tue, 6 Jun 2006, Roberto Rezende de Assis wrote:

> Hello, I would like to know where in the source-code of postgres is located 
> the code of the aggregate functions min, max, avg.

They're in src/backend/utils/adt/numeric.c

> I wish to develop more statistical aggregate functions, and I prefer to use C 
> than to write then in the PL/R.

Make sure you read section "32.10 User-Defined aggregates" in the manual:

http://www.postgresql.org/docs/current/interactive/xaggr.html

Also, take a look at contrib/intagg for another example.

- Heikki


pgsql-hackers by date:

Previous
From: Travis Cross
Date:
Subject: Re: Duplicate rows sneaking in despite PRIMARY KEY / UNIQUE
Next
From: "Joshua D. Drake"
Date:
Subject: Re: AGREGATE FUNCTIONS