Florian Pflug <fgp@phlo.org> writes:
> On Jan10, 2014, at 15:49 , Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Also, it might be reasonable for both the regular and the inverse
>> transition functions to be strict. If a null entering the window
>> does not matter, then a null exiting the window doesn't either, no?
> That's not true, I think, unless we're special-casing strict transition
> functions somewhere. AFAICS, an aggregate with a strict transition function
> will produce the state NULL whenever any of the inputs was NULL, i.e. we won't
> ever transition out of the NULL state once we got there.
Nope, not the case; read xaggr.sgml and/or the CREATE AGGREGATE reference
page. An aggregate with a strict transition function essentially just
ignores null input rows. I suspect the inverse transition function could
just be made strict with a similar special-case rule (viz, keep the old
transition value when deleting a null input from the window); but maybe
I'm missing something and it has to work harder than that anyway.
regards, tom lane