PgSanity

API—OSS—FREEyesDOCS4/5
PG5.8#12 of 26
—Web—Windows—MacoutLinux—Android—iOS

Ranked in SQL Linters and Formatters ·Free plan

About

PgSanity is ranked #12 of 26 in SQL linters and formatters on Inferse. It runs on Linux, Self-hosted. There is a free plan.

Compared 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

Where it ranks on Inferse

Sources