Skip to content

Support new v1.5 syntax for PEG grammar - #21172

Merged
lnkuiper merged 7 commits into
duckdb:v1.5-variegatafrom
Dtenwolde:peg-new-v1.5-syntax
Mar 11, 2026
Merged

lnkuiper merged 7 commits into
duckdb:v1.5-variegatafrom
Dtenwolde:peg-new-v1.5-syntax

Conversation

@Dtenwolde

Copy link
Copy Markdown
Member

Fixes https://github.com/duckdblabs/duckdb-internal/issues/7305

v1.5 introduced some new syntax:

This PR adds support for the new grammar for the PEG Parser.
For Alter RESET I added a more useful error message than the generic syntax error:

-- PostgreSQL parser
memory ⚫◗ ALTER TABLE tbl1 RESET ('foo'='baz');
Parser Error:
"'baz'"
-- PEG parser
memory ⚫◗ call enable_peg_parser();
┌─────────┐
│ success │
│ boolean │
└─────────┘
  0 rows
memory ⚫◗ ALTER TABLE tbl1 RESET ('foo'='baz');
Parser Error:
Reset option "foo" cannot set any value. Did you mean to use SET?

@Dtenwolde
Dtenwolde marked this pull request as draft March 4, 2026 09:53
@Dtenwolde
Dtenwolde marked this pull request as ready for review March 9, 2026 15:44
@lnkuiper
lnkuiper merged commit 3c5c475 into duckdb:v1.5-variegata Mar 11, 2026
115 of 151 checks passed
github-actions Bot pushed a commit to duckdb/duckdb-r that referenced this pull request Mar 18, 2026
Date: 2026-03-11 15:22:28 +0100

[Fix] Memory error when transforming to `v1.0.0` ART storage (duckdb/duckdb#21270)
Support new v1.5 syntax for PEG grammar (duckdb/duckdb#21172)
Implement line number reporting in errors for PEG parser (duckdb/duckdb#21157)
github-actions Bot added a commit to duckdb/duckdb-r that referenced this pull request Mar 18, 2026
Date: 2026-03-11 15:22:28 +0100

[Fix] Memory error when transforming to `v1.0.0` ART storage (duckdb/duckdb#21270)
Support new v1.5 syntax for PEG grammar (duckdb/duckdb#21172)
Implement line number reporting in errors for PEG parser (duckdb/duckdb#21157)

Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request Mar 22, 2026
Date: 2026-03-11 15:22:28 +0100

[Fix] Memory error when transforming to `v1.0.0` ART storage (duckdb/duckdb#21270)
Support new v1.5 syntax for PEG grammar (duckdb/duckdb#21172)
Implement line number reporting in errors for PEG parser (duckdb/duckdb#21157)

Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
krlmlr added a commit to krlmlr/duckdb-r-old that referenced this pull request Mar 22, 2026
Date: 2026-03-11 15:22:28 +0100

[Fix] Memory error when transforming to `v1.0.0` ART storage (duckdb/duckdb#21270)
Support new v1.5 syntax for PEG grammar (duckdb/duckdb#21172)
Implement line number reporting in errors for PEG parser (duckdb/duckdb#21157)

Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
krlmlr added a commit to krlmlr/duckdb-r-old that referenced this pull request Mar 22, 2026
Date: 2026-03-11 15:22:28 +0100

[Fix] Memory error when transforming to `v1.0.0` ART storage (duckdb/duckdb#21270)
Support new v1.5 syntax for PEG grammar (duckdb/duckdb#21172)
Implement line number reporting in errors for PEG parser (duckdb/duckdb#21157)

Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
kaka11chen pushed a commit to AstroVela/vane that referenced this pull request Aug 14, 2026
Fixes https://github.com/duckdblabs/duckdb-internal/issues/7305

v1.5 introduced some new syntax: 
- [x] [Add partition by, sorted by, and extra options for create table
statements](duckdb/duckdb#20431)
- [x] [Support alter table set/reset
options](duckdb/duckdb#20523)
- [x] [Support Partitioned by, Sorted by, and With in CTAS
statements](duckdb/duckdb#20728) (Still open at
the time of writing)

This PR adds support for the new grammar for the PEG Parser. 
For Alter `RESET` I added a more useful error message than the generic
syntax error:
```sql
-- PostgreSQL parser
memory ⚫◗ ALTER TABLE tbl1 RESET ('foo'='baz');
Parser Error:
"'baz'"
```
```sql
-- PEG parser
memory ⚫◗ call enable_peg_parser();
┌─────────┐
│ success │
│ boolean │
└─────────┘
  0 rows
memory ⚫◗ ALTER TABLE tbl1 RESET ('foo'='baz');
Parser Error:
Reset option "foo" cannot set any value. Did you mean to use SET?
```

Upstream-Commit: duckdb/duckdb@3c5c475
@Dtenwolde
Dtenwolde deleted the peg-new-v1.5-syntax branch August 18, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants