On Thu, 10 Sept 2026 at 19:29, Vik Fearing <[email protected]> wrote:
> > On 10/09/2026 18:16, Tom Lane wrote: > > Vik Fearing <[email protected]> writes: > >> It should be called PRODUCT and it should accept the syntax > >> PRODUCT(col, 1 ON EMPTY) > >> for when there are no non-nulls in the input. > > Sigh. The committee really loves to invent randomly creative syntax, > > don't they. At least this one won't force us to create any new > > fully-reserved words. > > > Yes. I tried to fight back on it but I was overruled. > Out of curiosity, was there any thought given to the idea that it should be an attribute of the aggregate itself? The following seem to me to be pretty hard to dispute: max -> -infinity; min -> infinity; sum -> 0; product -> 1; string_agg -> ''; array_agg -> []. Of course there is legacy behaviour that can't just be erased, but an option with just two choices defaulting to the NULL result could handle that.
