Re: Properly mark NULL returns in numeric aggregates - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Properly mark NULL returns in numeric aggregates
Date
Msg-id 12009.1586559587@sss.pgh.pa.us
Whole thread Raw
In response to Re: Properly mark NULL returns in numeric aggregates  (Jesse Zhang <sbjesse@gmail.com>)
Responses Re: Properly mark NULL returns in numeric aggregates
List pgsql-hackers
Jesse Zhang <sbjesse@gmail.com> writes:
> On the other hand, we examined the corresponding final functions
> (numeric_stddev_pop and friends), they all seem to carefully treat a
> NULL trans value the same as a "zero input" (as in, state.N == 0 &&
> state.NaNcount ==0). That does suggest to me that it should be fine to
> declare those combine functions as strict (barring the restriction that
> they should not be STRICT, anybody remembers why?).

They can't be strict because the initial iteration needs to produce
something from a null state and non-null input.  nodeAgg's default
behavior won't work for those because nodeAgg doesn't know how to
copy a value of type "internal".

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: spin_delay() for ARM
Next
From: Jeremy Morton
Date:
Subject: Re: Support for DATETIMEOFFSET