Re: ON EMPTY clause for aggregate and window functions - Mailing list pgsql-hackers

From Robert Haas
Subject Re: ON EMPTY clause for aggregate and window functions
Date
Msg-id CA+TgmoY2feo+4pbB6C84WPWOgv1Cfk8Y5sWfb=pi3jm4dm2COA@mail.gmail.com
Whole thread
In response to Re: ON EMPTY clause for aggregate and window functions  (Jeevan Chalke <jeevan.chalke@enterprisedb.com>)
Responses Re: ON EMPTY clause for aggregate and window functions
Re: ON EMPTY clause for aggregate and window functions
List pgsql-hackers
On Thu, Sep 24, 2026 at 9:18 AM Jeevan Chalke <jeevan.chalke@enterprisedb.com> wrote:
It only accepts ON EMPTY on sum() and product(), the two aggregates the
standard actually defines this for. At parse time, once we know the
call is sum() or product(), it is just rewritten to
COALESCE(sum(expr), default). Nothing else changes:

I can't get excited about supporting this syntax for just 2 aggregates and nothing else.

--
Robert Haas

pgsql-hackers by date:

Previous
From: Soumen
Date:
Subject: Request to expedite cool-off
Next
From: Tom Lane
Date:
Subject: Re: ON EMPTY clause for aggregate and window functions