PgTidy — VSCode Extension
Formats and lints PostgreSQL/PL-pgSQL files using the pgtidy language server.
Requirements
pgtidybinary onPATH(see Build the binary below)- Go 1.21+ (to build from source)
- VSCode 1.85+
Build the binary
Option A — install directly with Go (recommended):
go install git.warky.dev/wdevs/pgtidy/cmd/pgtidy@latest
The binary lands in $(go env GOPATH)/bin/. Make sure that directory is on your PATH.
Option B — build from source and place manually:
git clone https://git.warky.dev/wdevs/PgTidy
cd PgTidy
go build -o pgtidy ./cmd/pgtidy
# Linux / macOS — move to a directory on PATH
mv pgtidy /usr/local/bin/
# Windows — move to a directory on PATH, e.g.
# move pgtidy.exe C:\tools\
Verify the binary is reachable:
pgtidy version
If you place it somewhere not on PATH, set the full path in VSCode settings:
"pgtidy.path": "/path/to/pgtidy"
Install from .vsix
- Build the package:
pnpm run build && pnpm run package - In VSCode: Extensions →
···menu → Install from VSIX… → selectpgtidy-*.vsix
Or via CLI:
code --install-extension pgtidy-0.1.0.vsix
Settings
| Setting | Default | Description |
|---|---|---|
pgtidy.path |
"pgtidy" |
Path to the binary if not on PATH |
pgtidy.enable |
true |
Enable/disable the language server |
Features
- Format on save — configure via VSCode's
editor.formatOnSave - Diagnostics — lint findings shown inline as you type (MIG001–MIG003, COR001–003, NAM001–003)
- Quick fixes — lightbulb actions for MIG001 (add
CONCURRENTLY) and MIG003 (addNOT VALID)
.sql and .pgsql files are both handled.
Troubleshooting
No formatting / diagnostics: Open the Output panel → select PgTidy to see server errors. Most common cause: pgtidy not found — set pgtidy.path to the full binary path.