pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan Kohnert <nospam001-lists@jan-kohnert.de>
To: pgsql-general@lists.postgresql.org
Subject: Re: Implementing product-aggregate
Date: Thu, 14 Mar 2024 08:36:57 +0100
Message-ID: <9247987.CDJkKcVGEf@kohni-mobil> (raw)
In-Reply-To: <2176491.irdbgypaU6@kohni-mobil>
References: <2176491.irdbgypaU6@kohni-mobil>

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

view thread (4+ messages)  latest in thread

Message-ID: <9247987.CDJkKcVGEf@kohni-mobil>
Permalink:  ../9247987.CDJkKcVGEf@kohni-mobil/
Also on:    postgresql.org/message-id/9247987.CDJkKcVGEf@kohni-mobil

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: nospam001-lists@jan-kohnert.de
  Subject: Re: Implementing product-aggregate
  In-Reply-To: <9247987.CDJkKcVGEf@kohni-mobil>
  References: <2176491.irdbgypaU6@kohni-mobil> <9247987.CDJkKcVGEf@kohni-mobil>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox