Tech riderRev. 4 Oct 2026
- 1Runs onLinux, self-hosted
- 2CostsFree plan
- 3Supported SQL dialectsPostgreSQL
3 lines stated Written from the maker's own pages: github.com

Overview
PgSanity is ranked #11 of 26 in SQL linters and formatters on Specifiction. It runs on Linux, Self-hosted. There is a free plan.
PgSanity plans and pricing
All plansCompared on SQL linters and formatters
- Free plan
- Yesgithub.com
- Supported SQL dialects
- PostgreSQLgithub.com
Facts
- Purpose
- PgSanity checks the syntax of PostgreSQL SQL files.github.com · 4 Oct 2026
- 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.github.com · 4 Oct 2026
- File input
- It accepts one or multiple filenames and reports syntax errors with file and line information.github.com · 4 Oct 2026
- Standard input
- When no filenames are provided, it reads SQL from stdin for interactive use or piping.github.com · 4 Oct 2026
- Exit codes
- It exits with status 0 when SQL syntax looks good and 1 when errors are found.github.com · 4 Oct 2026
- Workflow integration
- The repository provides a pre-commit hook with the id pgsanity_lint.github.com · 4 Oct 2026
- Distribution
- The project is installable from PyPI with pip or uv and is also available through FreeBSD ports.github.com · 4 Oct 2026
- Dependencies
- The stated dependencies are Python 3.9 or later and ecpg; the README lists package names for Ubuntu/Debian, RHEL/CentOS, and Arch.github.com · 4 Oct 2026
- License
- PyPI lists the project’s license expression as MIT.pypi.org · 4 Oct 2026
- Security reporting
- The README directs users to report problems, including incorrect syntax results, through the GitHub repository.github.com · 4 Oct 2026
- Support
- The README points users to the GitHub project page to report problems.github.com · 4 Oct 2026
- Intended audience
- PyPI classifies the intended audience as developers, information technology, and system administrators.pypi.org · 4 Oct 2026
- Maintainer
- PyPI lists Mark Drago as the project’s sole maintainer and author.pypi.org · 4 Oct 2026
Best PgSanity alternatives
See all 20 All accessCh 01 Squawk AndroidAPI 7.4 All accessCh 02 sqlfmt Free planAPILinux Free to start7.3 All accessCh 03 Poor SQL Free planAPILinux Free to start7.2 All accessCh 04 Sqruff Free planBrowserLinux Free to start7.2 All accessCh 05 TSQLLint Free planBrowserLinux Free to start7.2 All accessCh 06 JSQLFormatter Free planLinuxMac Free to start7.1
Where it ranks on Specifiction
Is PgSanity yours?
Claim it for free: prove the domain, then correct facts, plans and screenshots. An editor reviews every change.
Sources
- github.com/markdrago/pgsanity· checked 4 Oct 2026
- pypi.org/project/pgsanity/· checked 4 Oct 2026