Inconsistent Behavior of GROUP BY ROLLUP in v17 vs master
邱宇航 <iamqyh@gmail.com>
From: 邱宇航 <iamqyh@gmail.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-09-23T03:48:58Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix test case from 40c242830
- ee49f2cf447a 18.1 landed
-
Fix pushdown of degenerate HAVING clauses
- 40c2428307b8 18.1 landed
- 18d261409348 19 (unreleased) landed
-
Allow pushdown of HAVING clauses with grouping sets
- 67a54b9e83d3 18.0 cited
-
Mark expressions nullable by grouping sets
- f5050f795aea 18.0 cited
I've noticed that two GROUP BY ROLLUP queries behave differently in v17 compared to master and REL_18_STABLE. The issue can be reproduced by following SQL: ``` SQL CREATE TABLE t(id int); INSERT INTO t SELECT generate_series(1, 3); -- Query 1 SELECT DISTINCT 'XXX' FROM t GROUP BY ROLLUP (id, 1); -- Query 2 SELECT 'XXX' FROM t GROUP BY ROLLUP(id) HAVING NOT (NULL IS NULL); ``` After some git bisect work, I traced the root cause: - The first issue was introduced by commit f5050f79 (Mark expressions nullable by grouping sets). - The second issue stems from commit 67a54b9e (Allow pushdown of HAVING clauses with grouping sets). Best regards, Yuhang Qiu