pgfmt 2.1: in-place formatting and pg_dump-compatible output

Поиск
Список
Период
Сортировка
Искать

pgfmt 2.1: in-place formatting and pg_dump-compatible output

От:
"Gavin M. Roy via PostgreSQL Announce" <announce-noreply@postgresql.org>
Дата:
 

pgfmt 2.1: in-place formatting and pg_dump-compatible output

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

This email was sent to you from Gavin M. Roy. It was delivered on their behalf by the PostgreSQL project. Any questions about the content of the message should be sent to Gavin M. Roy.

You were sent this email as a subscriber of the pgsql-announce mailinglist, for the content tag Related Open Source. To unsubscribe from further emails, or change which emails you want to receive, please click the personal unsubscribe link that you can find in the headers of this email, or visit https://lists.postgresql.org/unsubscribe/.
 
FAQ