You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] JSQLParser : PostgreSQL : GROUP BY DISTINCT with GROUPING SETS fails to parse #2785
PostgreSQL supports GROUP BY DISTINCT with GROUPING SETS. The DISTINCT modifier removes duplicate grouping sets before processing (PostgreSQL documentation).
JSQLParser fails to parse this query.
SQL Example
SELECT1GROUP BY DISTINCT GROUPING SETS ((1), (1));
This query executes successfully in PostgreSQL and returns: 1
Parsing error
JSQLParser throws the following exception:
ParseException: Encountered:, at line 1, column 19, in lexical state DEFAULT.
The error is reported at DISTINCT, immediately after GROUP BY.
I am sorry for asking bluntly: do we really want to support just anything or should we ask ourselves first "Why is it there and what value does it add"?
We lost 10% of performance between last release and current snapshot already from adding functions.
I feel like any further sacrifice should be well justified by a practical use-case.
(And I have strong prejudice against non-portable SQL.)
Activity
fudianchn commentedon Oct 13, 2026
First time seeing this cursed syntax — I'm off to figure out what it's actually useful for.
manticore-projects commentedon Oct 13, 2026
@fudianchn I do agree.
I am sorry for asking bluntly: do we really want to support just anything or should we ask ourselves first "Why is it there and what value does it add"?
We lost 10% of performance between last release and current snapshot already from adding functions.
I feel like any further sacrifice should be well justified by a practical use-case.
(And I have strong prejudice against non-portable SQL.)