Hi, On 30 November 2012 08:06, Michael Giannakopoulos <miccagiann@xxxxxxxxx> 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 -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general