Re: About aggregates...

From: Ondrej Ivanič <ondrej(dot)ivanic(at)gmail(dot)com>
To: Michael Giannakopoulos <miccagiann(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: About aggregates...
Date: 2012-11-29 21:25:07
Message-ID: CAM6mieLhSAzLeu+=e6GH-z5ASXhe7FHezVx3shdf0uvNNcp_pg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

On 30 November 2012 08:06, Michael Giannakopoulos <miccagiann(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2012-11-29 21:38:00 Re: About aggregates...
Previous Message Michael Giannakopoulos 2012-11-29 21:06:43 About aggregates...