↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Other improvements

Posted on 2026-06-21T00:00:00Z · Gavin M. Roy · PostgreSQL News
related

pgfmt 2.1 lands two headline features, plus a steady stream of formatting coverage improvements driven by libpgfmt. It is also now installable from a Homebrew tap.

brew tap gmr/pgfmt && brew install pgfmt

The install script, cargo install pgfmt, and prebuilt release binaries all remain available.

--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

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_functiondef. On genuine deparser output it is byte-idempotent: format a catalog dump and you get the same bytes back. Useful for diffing migrations against what PostgreSQL actually stores.

The 2.1.x line also expanded formatting coverage across SQL and PL/pgSQL and fixed several correctness bugs, including typed string literals (INTERVAL '2 days') that were previously dropped. Catalog-dumped views and functions that used to fail now format cleanly.

See the release notes for the full list.

Original source ↗

Source records
  • center.news_newsarticle · 3321 · 2026-10-03T04:08:35.169032Z
  • official:news · n3321 · 2026-10-03T04:37:36.9101Z
  • pgweb.news_newsarticle · 3321 · 2026-10-03T04:08:55.967155Z