docs/features/syntax_diagnostics.md
The Postgres Language Server reports diagnostics for syntax errors in your SQL files. Syntax diagnostics are enabled by default and cannot be disabled.
The language server uses libpg_query to parse SQL statements, which is the actual Postgres parser packaged as a library. This ensures 100% compatibility with Postgres syntax.
When you type or modify SQL, the language server:
libpg_query:param and @param to positional parameters ($1, $2) so the Postgres parser understands them and the LSP works with ORMs and other toolingPL/pgSQL: In addition to SQL, also validates PL/pgSQL function bodies for basic syntax errorsSyntax errors include:
libpg_query does not always provide precise positions)Note: For more advanced PL/pgSQL validation beyond basic syntax, see the PL/pgSQL feature which integrates with the plpgsql_check extension.