On Sat, Sep 12, 2026 at 9:19 AM Jeevan Chalke
<[email protected]> wrote:
> ON EMPTY is now implemented as exactly:
>
>     agg(args, default ON EMPTY)  ==  COALESCE(agg(args), default)
>
> for both plain and window aggregates: compute the aggregate's ordinary
> result exactly as without ON EMPTY, and substitute the default only if that
> result is NULL. No new expression-evaluation step, no per-row bookkeeping,
> and no restriction on partial/parallel aggregation.

This seems pretty useless -- the new syntax is more work for us to
maintain, and doesn't really add any value over just using COALESCE.

To be clear, I expect to lose this argument on the grounds that
apparently this syntax is in the spec and therefore we ought to
support it. But I don't understand why the spec -- or we -- should
spend time inventing new ways to spell existing behaviors. That just
seems confusing (and this particular choice of syntax seems
extra-confusing).

-- 
Robert Haas


Reply via email to