@pgsql/lint
Lint Your SQL Before It Ships
A linter for SQL and PL/pgSQL that reads function definitions as ASTs, with no database connection. It flags search_path tricks, unqualified references and dynamic SQL in migrations, editors and CI.
Pure AST analysis of the SQL text
Lint only the .sql files a branch changed
ESLint-style inline comments, kept as accepted risk
Four rules for SQL that never depends on search_path
Flags SET search_path clauses and set_config calls on search_path (C1).
Flags unqualified relations, so FROM users becomes FROM app_public.users (C3).
Flags EXECUTE in all its forms; a waiver must say why (C4).
Flags #variable_conflict directives instead of letting them hide name clashes (C2).
pgsql-lint scans files or directories and reads .pgsqllintrc.json, with extends, ignores and severities.
--changed lints just what the branch touched against its merge base, so a CI gate takes seconds.
Point pgsql-lint at files or directories. It exits 1 when an error-level finding remains, so it drops straight into CI.
Suppress a finding in the function body itself. The comment survives pg_get_functiondef, and the finding is reported as acknowledged.