Re: Parameters in user-defined aggregate final functions

2018-01-11 Thread Tom Lane
Robert Haas writes: > On Thu, Jan 11, 2018 at 6:11 PM, Tom Lane wrote: >> So define it as an ordered-set aggregate, and just ignore the question >> of whether you need to sort the input (which is something that we leave >> to the aggregate function to do anyway). The syntax would be a little >>

Re: Parameters in user-defined aggregate final functions

2018-01-11 Thread Robert Haas
On Thu, Jan 11, 2018 at 6:11 PM, Tom Lane wrote: > Esteban Zimanyi writes: >> How to tell PostgreSQL that my final function also needs a parameter? I am >> working on PostgreSQL 10.1. I know that according to the documentation >> direct parameters are only allowed for ordered-set aggregates, but

Re: Parameters in user-defined aggregate final functions

2018-01-11 Thread Tom Lane
Esteban Zimanyi writes: > How to tell PostgreSQL that my final function also needs a parameter? I am > working on PostgreSQL 10.1. I know that according to the documentation > direct parameters are only allowed for ordered-set aggregates, but I would > also need a direct parameter for "normal" agg

Re: Parameters in user-defined aggregate final functions

2018-01-11 Thread David Fetter
On Thu, Jan 11, 2018 at 08:51:27PM +0100, Esteban Zimanyi wrote: > I am creating a user-defined aggregate function that needs an additional > parameter. More precisely it is a cumulative (aka window) minimum that > takes as second parameter a time interval defining the window. Since the > aggregate

Parameters in user-defined aggregate final functions

2018-01-11 Thread Esteban Zimanyi
I am creating a user-defined aggregate function that needs an additional parameter. More precisely it is a cumulative (aka window) minimum that takes as second parameter a time interval defining the window. Since the aggregate function operates on my user-defined data types I have conveyed a dummy