Recognize GROUPING() as a aggregate expression.
Andres Freund <andres@anarazel.de>
Recognize GROUPING() as a aggregate expression. Previously GROUPING() was not recognized as a aggregate expression, erroneously allowing the planner to move it from HAVING to WHERE. Author: Jeevan Chalke Reviewed-By: Andrew Gierth Discussion: CAM2+6=WG9omG5rFOMAYBweJxmpTaapvVp5pCeMrE6BfpCwr4Og@mail.gmail.com Backpatch: 9.5, where grouping sets were introduced
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/util/clauses.c | modified | +6 −1 |
| src/test/regress/expected/groupingsets.out | modified | +62 −0 |
| src/test/regress/sql/groupingsets.sql | modified | +17 −0 |