Re: [PATCH] Fix grouping-set nulling of variable-free grouping expressions

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Haibo Yan <tristan(dot)yim(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [PATCH] Fix grouping-set nulling of variable-free grouping expressions
Date: 2026-10-21 00:48:09
Message-ID: CAGRkXqTbwvQKNaGuWwOvH0-DMTvdrC_wBRpu9GzQC5dOzgDMcA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Haibo,

I agree with both rules. On your CUBE example, 17 and 18 also give 2 rows,
so master's 4 is right.

v3 alone has one more problem. SELECT 1 AS x GROUP BY ROLLUP(x) HAVING 1
IS NOT NULL returns 2 rows on master but 1 with v3. The parser turns the
1 in HAVING into a GROUP Var.

A question on (b). SELECT now() IS NULL AS n GROUP BY ROLLUP(now())
gives f and t on 17 and with v3, but f and f on 18 and master. (b)
should keep f and f, which seems fine to me.

Thanks,
Shihao

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message shihao zhong 2026-10-21 00:39:11 Re: [PG19] Promotion hangs behind a backend blocked on a stuck client