Lukas Fittl: Introducing pg_query for Postgres 16 - Parsing SQL/JSON, Windows support, PL/pgSQL parse mode & more
原文英文,约1900词,阅读约需7分钟。发表于: 。Parsing SQL queries and turning them into a syntax tree is not a simple task. Especially when you want to support special syntax that is specific to a particular database engine, like Postgres. And when you’re working with queries day in day out, like we do at pganalyze, understanding the actual intent of a query, which tables it scans, which columns it filters on, and such, is essential. Almost 10 years ago, we determined that in order to create the best product for monitoring and optimizing…
pg_query has released a new version based on the Postgres 16 parser, which includes support for running on Windows and parsing new Postgres syntax. The library can parse SQL queries and return a Postgres parse tree. It also introduces query fingerprints to group queries together and supports deparsing to upgrade queries to Postgres 16 SQL/JSON syntax. The new release also includes support for parsing PL/pgSQL expressions. The community has played a significant role in the development of pg_query, and the team is looking to upstream parts of pg_query as a core part of Postgres.