Re: ON EMPTY clause for aggregate and window functions

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Jeevan Chalke <jeevan(dot)chalke(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Isaac Morland <isaac(dot)morland(at)gmail(dot)com>
Subject: Re: ON EMPTY clause for aggregate and window functions
Date: 2026-09-28 17:53:18
Message-ID: 874f81bf-8e29-4410-92f3-a916650dbc1c@postgresfriends.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 28/09/2026 19:36, Robert Haas wrote:
> On Thu, Sep 24, 2026 at 9:18 AM Jeevan Chalke
> <jeevan(dot)chalke(at)enterprisedb(dot)com> wrote:
>
> It only accepts ON EMPTYon 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.

Certainly not. Either we make it generic like we always do, or we drop
it entirely.

--

Vik Fearing

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2026-09-28 18:38:32 Re: Parallel autovacuum: DROP DATABASE WITH (FORCE) fails on the parallel workers
Previous Message Tom Lane 2026-09-28 17:40:44 Re: ON EMPTY clause for aggregate and window functions