DATABASES Signal 499
DuckDB v2.0 replaces its PostgreSQL-derived SQL parser with a PEG-based parser
DuckDB v2.0 swaps its PostgreSQL-derived SQL parser for a PEG-based one, keeping the DuckSQL dialect unchanged while making the grammar easier to evolve and runtime-extensible.
For engineers using DuckDB, the parser change is transparent: existing SQL queries continue to work because the DuckSQL dialect is unchanged. The new PEG-based parser makes it easier for DuckDB to add new syntax features and could allow runtime extension of the grammar, which was difficult with the old Bison-based parser.
Written by elseif from the cluster below · every claim links back to a sourceThe three things worth knowing
DuckDB v2.0 replaces its PostgreSQL-derived parser with a PEG-based parser without changing the accepted SQL dialect.
The old Bison/LALR parser caused shift/reduce and reduce/reduce conflicts that made grammar extensions difficult.
The new PEG parser is designed to be easier to evolve and can be extended at runtime, according to the article.
THE CLUSTER