public inbox for [email protected]  
help / color / mirror / Atom feed
From: Gavin M. Roy via PostgreSQL Announce <[email protected]>
To: PostgreSQL Announce <[email protected]>
Subject: pgfmt 2.1: in-place formatting and pg_dump-compatible output
Date: Thu, 18 Jun 2026 19:03:22 +0000
Message-ID: <[email protected]> (raw)

[pgfmt](https://gmr.github.io/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.

# Install via Homebrew

`brew tap gmr/pgfmt && brew install pgfmt`

The install script, cargo install pgfmt, and [prebuilt release binaries](https://github.com/gmr/pgfmt/releases/tag/v2.1.7) 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_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.

# Other improvements

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](https://github.com/gmr/pgfmt/releases).

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgfmt 2.1: in-place formatting and pg_dump-compatible output
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox