Commits on Aug 21, 2026
-
Add PRODUCT() aggregate function
This commit introduces the PRODUCT() aggregate to compute the product of all input values in a set. The following input types are supported: int2, int4, int8, float4, float8, and numeric. The internal transition state uses the numeric type to prevent overflow during multiplication. For non-numeric inputs, dedicated accumulator functions (*_product_accum) handle the promotion to numeric before invoking numeric_mul for the transition steps. Because division by zero (or near-zero) makes inverse operations unreliable or undefined, this implementation does not provide inverse transition functions. Moving aggregates will instead fall back to the standard recalculation behavior. Includes regression tests for all supported types, including edge cases involving NULLs, along with relevant documentation updates. New catalog entries require a CATALOG_VERSION_NO bump. Omitted here to avoid conflicts with concurrent commits; committer should bump at commit time. Proposed-by: Peter Eisentraut Jeevan Chalke