Re: Add PRODUCT() aggregate function - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: Add PRODUCT() aggregate function
Date
Msg-id CAEZATCWScc_bu0GHuLv-OsR5UFXUaaQRSqh+J3twuNnvJRKvUA@mail.gmail.com
Whole thread
Responses Re: Add PRODUCT() aggregate function
List pgsql-hackers
On Tue, 23 Jun 2026 at 09:37, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
>
> On Tue, 23 Jun 2026 at 08:49, Jeevan Chalke
> <jeevan.chalke@enterprisedb.com> wrote:
> >
> > PRODUCT() returns the product of all non-null input values.  It is defined for
> > int2, int4, int8, float4, float8 and numeric input, and always returns numeric.
>
> I don't think that you need to define it for all those types. I
> suspect that you could just define it for numeric and float8, and let
> implicit casting do the rest.

... and perhaps make the float8 version return float8.

Regards,
Dean



pgsql-hackers by date:

Previous
From: Akshay Joshi
Date:
Subject: Re: Fix variadic argument types for pg_get_xxx_ddl() functions
Next
From: Amit Kapila
Date:
Subject: Re: Add a hook for handling logical decoding messages on subscribers.