# DuckDB v2.0: Your Database Deserves a Better Parser

DevFeed: [DuckDB v2.0: Your Database Deserves a Better Parser](<https://devfeed.tech/articles/duckdb-v2-0-your-database-deserves-a-better-parser-4796.md>)

Original publisher: [Read original article](<https://duckdb.org/2026/08/20/duckdb-20-peg-parser.html>)

Author: Daniël ten Wolde

Published: 2026-08-20T00:00:00Z

Content type: release

Language: en

Sources: [DuckDB](<https://devfeed.tech/sources/duckdb.md>)

Topics: [DuckDB](<https://devfeed.tech/topics/duckdb.md>), [Parser](<https://devfeed.tech/topics/parser.md>), [SQL](<https://devfeed.tech/topics/sql.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [duckdb](<https://devfeed.tech/tags/duckdb.md>), [peg](<https://devfeed.tech/tags/peg.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [release](<https://devfeed.tech/tags/release.md>), [runtime](<https://devfeed.tech/tags/runtime.md>), [sql](<https://devfeed.tech/tags/sql.md>), [v2](<https://devfeed.tech/tags/v2.md>)

## AI overview

DuckDB v2.0 replaces its PostgreSQL-derived parser with a PEG parser while keeping DuckSQL and the downstream AST, binder, and query pipeline intended to behave as before. The change addresses the growing difficulty of extending the old Bison/LALR grammar, whose additions could trigger shift/reduce or reduce/reduce conflicts. The new parser supports the full dialect and uses packrat memoization to avoid repeated work on malformed inputs; this adds memory use, while the article reports a test case with 19 unmatched opening parentheses falling from 10.640 seconds in the v1.5 experimental parser to 0.001 seconds. PEG rules also let extensions add syntax and reuse DuckDB grammar and transformations. The runtime extension API described is a preview and may change before v2.0; existing queries are expected to continue working, and the article asks users to report differences.

## Source excerpt

DuckDB v2.0 replaces its PostgreSQL-derived SQL parser with a PEG-based parser that is easier to evolve and can be extended at runtime.