Re: About aggregates... - Mailing list pgsql-general

From Ondrej Ivanič
Subject Re: About aggregates...
Date
Msg-id CAM6mieLhSAzLeu+=e6GH-z5ASXhe7FHezVx3shdf0uvNNcp_pg@mail.gmail.com
Whole thread Raw
In response to About aggregates...  (Michael Giannakopoulos <miccagiann@gmail.com>)
List pgsql-general
Hi,

On 30 November 2012 08:06, Michael Giannakopoulos <miccagiann@gmail.com> wrote:
> However an aggregate function
> feeds me one a tuple for each call, but I would like to have access to a
> batch of tuples per function call. Is there any possible way to perform
> something like this?

Yes, this might be good for you::

WINDOW
WINDOW indicates that the function is a window function rather than a
plain function. This is currently only useful for functions written in
C. The WINDOW attribute cannot be changed when replacing an existing
function definition.
http://www.postgresql.org/docs/9.1/static/sql-createfunction.html

Apart from C you can use this in Pl/R:
http://www.joeconway.com/plr/doc/plr-window-funcs.html


--
Ondrej


pgsql-general by date:

Previous
From: Michael Giannakopoulos
Date:
Subject: About aggregates...
Next
From: "David Johnston"
Date:
Subject: Re: About aggregates...