Re: Implementing product-aggregate

2024-03-14 Thread Jan Kohnert
Hello, Am Donnerstag, 14. März 2024, 15:17:58 CET schrieb Tom Lane: > I wouldn't be concerned about relying on numeric_mul (or any of the > other functions underlying standard operators). They're undocumented > only because documenting both the functions and the operators would > bloat the docume

Re: Implementing product-aggregate

2024-03-14 Thread Tom Lane
Jan Kohnert writes: > Am Montag, 11. März 2024, 10:16:33 CET schrieb Jan Kohnert: >> create aggregate prod(numeric) (sfunc = numeric_mul, stype = numeric) > ... > Then again, this seems odd, too, since we're only reimplementing basic stuff > that's > already there. I wouldn't be concerned about

Re: Implementing product-aggregate

2024-03-14 Thread Jan Kohnert
Hi again, Am Montag, 11. März 2024, 10:16:33 CET schrieb Jan Kohnert: > create aggregate prod(numeric) (sfunc = numeric_mul, stype = numeric) my basic idea was creating a function create function multiply(arg1 numeric, arg2 numeric) returns numeric language sql immutable returns

Implementing product-aggregate

2024-03-11 Thread Jan Kohnert
Hi, we need a product aggregate and used to implement this as exp(sum(ln([COLUMN]))) While using the sum of logarithms is working RDBMS-independently, we'd like to switch to a more PostgreSQL native way of doing this and implement an aggregate to be used. Currently the implementation is crea