//
Search across all documentation pages
How to make Postgres project rules stick: automate linting, embed checks in CI, and keep human review for what machines cannot judge.
db/migrations/** in CI. Fail PR on parse and layout violations.SET lock_timeout in migration files. Regex or AST check in pipeline.idx_.EXPLAIN (ANALYZE, BUFFERS) output.# SQLFluff CI example
sqlfluff lint db/migrations --dialect postgres
# Custom migration header check
grep -L "lock_timeout" db/migrations/V*.sql && exit 1 || true# CODEOWNERS excerpt
/db/migrations/ @data-platform-team
/docs/adr/ @staff-engineers @dba-team-- noqa: RULE and PR justification only.Lint catches style and some anti-patterns; humans judge plan quality and capacity impact. Both required.
Subset: read-only access, LIMIT, no prod writes - link psql best practices doc.
Stack versions: This page was written for PostgreSQL 18.4 (stable 18, maintenance 17), pgvector 0.8+, PgBouncer 1.x, Patroni 3.x, and PostGIS 3.5+.