Skip to content

Commit e931678

Browse files
committed
Support GROUP BY () in PostgreSQL
1 parent 86ff2d5 commit e931678

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/parser.pegjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,7 @@ group_by_distinct
801801

802802
grouping_element
803803
= group_by_rollup
804+
/ paren$empty_list
804805
/ expr
805806

806807
group_by_rollup

test/select/group_by.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ describe("select GROUP BY", () => {
1313
it("supports GROUP BY with list expression", () => {
1414
testClauseWc("GROUP BY (id, name), age");
1515
});
16+
dialect("postgresql", () => {
17+
it("supports GROUP BY empty list", () => {
18+
testClauseWc("GROUP BY ()");
19+
testClauseWc("GROUP BY foo, (), bar, ()");
20+
});
21+
});
1622

1723
dialect(["bigquery", "postgresql"], () => {
1824
it("supports GROUP BY ROLLUP()", () => {

0 commit comments

Comments
 (0)