pgfmt 2.1: in-place formatting and pg_dump-compatible output (opens in new tab)
Install via Homebrew brew tap gmr/pgfmt && brew install pgfmt The install script, cargo install pgfmt, and all remain available. In-place formatting --inplace / -i writes formatted output back to the source file instead of stdout, preserving the original file permissions. It takes multiple files: pgfmt -i query1.sql query2.sql pg_dump style pgfmt --style pg_dump (aliases pgdump, postgres) reproduces PostgreSQL's ruleutils.c deparser layout, the output you get from pg_get_viewdef and pg_get_fu...
Read the original article