Skip to content
SPECIFICTION
Get listed

PgSanity

github.com

Free plan LinuxSelf-hosted
Visit github.com
Spec score 7.9 #11 of 26 in SQL Linters and Formatters

Spec sheet

Purpose
PgSanity checks the syntax of PostgreSQL SQL files.Read 4 Oct 2026 · github.com
Support
The README points users to the GitHub project page to report problems.Read 4 Oct 2026 · github.com
License
PyPI lists the project’s license expression as MIT.Read 4 Oct 2026 · pypi.org
Dependencies
The stated dependencies are Python 3.9 or later and ecpg; the README lists package names for Ubuntu/Debian, RHEL/CentOS, and Arch.Read 4 Oct 2026 · github.com
Distribution
The project is installable from PyPI with pip or uv and is also available through FreeBSD ports.Read 4 Oct 2026 · github.com
Exit codes
It exits with status 0 when SQL syntax looks good and 1 when errors are found.Read 4 Oct 2026 · github.com
File input
It accepts one or multiple filenames and reports syntax errors with file and line information.Read 4 Oct 2026 · github.com
How it works
It wraps bare SQL as embedded SQL in a C-like file and uses ecpg, which uses PostgreSQL’s parser, to report syntax errors.Read 4 Oct 2026 · github.com
Intended audience
PyPI classifies the intended audience as developers, information technology, and system administrators.Read 4 Oct 2026 · pypi.org
Maintainer
PyPI lists Mark Drago as the project’s sole maintainer and author.Read 4 Oct 2026 · pypi.org
Security reporting
The README directs users to report problems, including incorrect syntax results, through the GitHub repository.Read 4 Oct 2026 · github.com
Standard input
When no filenames are provided, it reads SQL from stdin for interactive use or piping.Read 4 Oct 2026 · github.com
Workflow integration
The repository provides a pre-commit hook with the id pgsanity_lint.Read 4 Oct 2026 · github.com

Plans and prices

Free Free Open-source Python package · requires Python ≥3.9 and ecpg Read 4 Oct 2026 · github.com

Every PgSanity plan and price →

Where Specifiction places it

Alternatives to PgSanityAll alternatives →