Re: Implementing product-aggregate - Mailing list pgsql-general

From Jan Kohnert
Subject Re: Implementing product-aggregate
Date
Msg-id 9247987.CDJkKcVGEf@kohni-mobil
Whole thread Raw
In response to Implementing product-aggregate  (Jan Kohnert <nospam001-lists@jan-kohnert.de>)
Responses Re: Implementing product-aggregate
List pgsql-general

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 null on null input

    return arg1 * arg2;

and use that function instead of the undocumented numeric_mul as the sfunc in the aggregate definition.

Then again, this seems odd, too, since we're only reimplementing basic stuff that's already there.

I'm still undecided...

--

MfG Jan

pgsql-general by date:

Previous
From: Stephen Frost
Date:
Subject: Re: could not open file "global/pg_filenode.map": Operation not permitted
Next
From: Tom Lane
Date:
Subject: Re: Implementing product-aggregate