Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1waI25-001fSl-1m for pgsql-announce@arkaria.postgresql.org; Thu, 18 Jun 2026 19:04:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1waI23-00DBaI-1a for pgsql-announce@arkaria.postgresql.org; Thu, 18 Jun 2026 19:04:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1waI22-00DBa9-1s for pgsql-announce@lists.postgresql.org; Thu, 18 Jun 2026 19:04:06 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1waI21-000000011Gj-0lWh for pgsql-announce@lists.postgresql.org; Thu, 18 Jun 2026 19:04:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:From:To:Subject: MIME-Version:Content-Type:Sender:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=My+Ue6v3NLuCqYqRLabuXMuLYRWpyjexJtQsUO2PeBo=; b=xTc9LTKQyDLZsEWV0foV0nuV6T OVI0dMU6+j0u56wL9f5O7rCM1Y8GDUfQEHhrzAPk9LgVYXSThgJVUDXXp2JpWY4qdtL/c9J7caAdX 0Ne66tBtLPTTqd9+XqnOb3pTgi/ItVqE/O5YbXhAS+kCmas1va5VqO2a7l1fYHYTUpwvG2ZODwTEE RRvKwG/A4/7hD1GRqb57WdyziLVQGOMWwJKfyMTKEpbewSae7yiLsQNUr/qW0KYOnFzxtzgbY6j78 SGzsRKsvr7jRn008Hllouxn+21aNIuEBaaIHGKRhriSE5rp9Okdi9Ww7jEmmqH2eVFJlj3ELvAVpw gYNXCxOQ==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1waI1z-00355T-1x for pgsql-announce@lists.postgresql.org; Thu, 18 Jun 2026 19:04:04 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1waI1y-006wdR-2J for pgsql-announce@lists.postgresql.org; Thu, 18 Jun 2026 19:04:03 +0000 Content-Type: multipart/alternative; boundary="===============5442245339083268644==" MIME-Version: 1.0 Subject: pgfmt 2.1: in-place formatting and pg_dump-compatible output To: PostgreSQL Announce From: "Gavin M. Roy via PostgreSQL Announce" Reply-To: gavinmroy@gmail.com Date: Thu, 18 Jun 2026 19:03:22 +0000 Message-ID: <178180940244.774.1804930164641759759@wrigleys.postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-pglister-tags: related X-pglister-tagsig: 70080465ab3739680540206bf82595595447a4478d3d26f80e36a6a8424478aa List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --===============5442245339083268644== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable [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](ht= tps://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 file= s: `pgfmt -i query1.sql query2.sql` # pg_dump style `pgfmt --style pg_dump` (aliases `pgdump`, `postgres`) reproduces PostgreSQ= L'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 an= d fixed several correctness bugs, including typed string literals `(INTERVA= L '2 days')` that were previously dropped. Catalog-dumped views and functions that used to fail now format cleanly.=20 [See the release notes for the full list](https://github.com/gmr/pgfmt/rele= ases). --===============5442245339083268644== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable pgfmt 2.1: in-place formatting and pg_dump-compatible output</ti= tle> <style> @media only screen and (max-width: 620px) { table[class=3Dbody] h1 { font-size: 28px !important; margin-bottom: 10px !important; } table[class=3Dbody] p, table[class=3Dbody] ul, table[class=3Dbody] ol, table[class=3Dbody] td, table[class=3Dbody] span, table[class=3Dbody] a { font-size: 16px !important; } table[class=3Dbody] .wrapper, table[class=3Dbody] .article { padding: 10px !important; } table[class=3Dbody] .content { padding: 0 !important; } table[class=3Dbody] .container { padding: 0 !important; width: 100% !important; } table[class=3Dbody] .main { border-left-width: 0 !important; border-radius: 0 !important; border-right-width: 0 !important; } table[class=3Dbody] .btn table { width: 100% !important; } table[class=3Dbody] .btn a { width: 100% !important; } table[class=3Dbody] .img-responsive { height: auto !important; max-width: 100% !important; width: auto !important; } } @media all { .ExternalClass { width: 100%; } .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; } .apple-link a { color: inherit !important; font-family: inherit !important; font-size: inherit !important; font-weight: inherit !important; line-height: inherit !important; text-decoration: none !important; } #MessageViewBody a { color: inherit; text-decoration: none; font-size: inherit; font-family: inherit; font-weight: inherit; line-height: inherit; } .btn-primary table td:hover { background-color: #34495e !important; } .btn-primary a:hover { background-color: #34495e !important; border-color: #34495e !important; } } </style> </head> <body class=3D"" style=3D"background-color: #f6f6f6; font-family: sans-se= rif; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4= ; margin: 0; padding: 0; -ms-text-size-adjust: 100%; -webkit-text-size-adju= st: 100%;"> <table border=3D"0" cellpadding=3D"0" cellspacing=3D"0" class=3D"body" = style=3D"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace= : 0pt; width: 100%; background-color: #f6f6f6;"> <tr> <td style=3D"font-family: sans-serif; font-size: 14px; vertical-ali= gn: top;"> </td> <td class=3D"container" style=3D"font-family: sans-serif; font-size= : 14px; vertical-align: top; display: block; Margin: 0 auto; max-width: 580= px; padding: 10px; width: 580px;"> <div class=3D"content" style=3D"box-sizing: border-box; display: = block; Margin: 0 auto; max-width: 580px; padding: 10px;"> <span class=3D"preheader" style=3D"color: transparent; display:= none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden= ; mso-hide: all; visibility: hidden; width: 0;"></span> <table class=3D"main" style=3D"border-collapse: separate; mso-t= able-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background: #ffffff; = border-radius: 3px;"> <tr> <td class=3D"wrapper" style=3D"font-family: sans-serif; fon= t-size: 14px; vertical-align: top; box-sizing: border-box; padding: 20px;"> <table border=3D"0" cellpadding=3D"0" cellspacing=3D"0" s= tyle=3D"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace:= 0pt; width: 100%;"> <tr> <td style=3D"font-family: sans-serif; font-size: 14px= ; vertical-align: top;"> <div> <h1 style=3D"color: #000; font-family: sans-serif; line-height: 1.4; margin= : 0; margin-bottom: 30px; font-size: 25px; font-weight: 300; text-align: ce= nter">pgfmt 2.1: in-place formatting and pg_dump-compatible output</h1> </div> <p style=3D"font-family: sans-serif; font-size: 14px; font-weight: normal; = margin: 0; margin-bottom: 15px"><a href=3D"https://gmr.github.io/pgfmt/" st= yle=3D"color: #3498db; text-decoration: underline">pgfmt</a> 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.</p> <h1 style=3D"color: #000; font-family: sans-serif; line-height: 1.4; margin= : 0; margin-bottom: 30px; font-size: 25px; font-weight: 300; text-align: ce= nter">Install via Homebrew</h1> <p style=3D"font-family: sans-serif; font-size: 14px; font-weight: normal; = margin: 0; margin-bottom: 15px"><code>brew tap gmr/pgfmt && brew in= stall pgfmt</code></p> <p style=3D"font-family: sans-serif; font-size: 14px; font-weight: normal; = margin: 0; margin-bottom: 15px">The install script, cargo install pgfmt, an= d <a href=3D"https://github.com/gmr/pgfmt/releases/tag/v2.1.7" style=3D"col= or: #3498db; text-decoration: underline">prebuilt release binaries</a> all = remain available.</p> <h1 style=3D"color: #000; font-family: sans-serif; line-height: 1.4; margin= : 0; margin-bottom: 30px; font-size: 25px; font-weight: 300; text-align: ce= nter">In-place formatting</h1> <p style=3D"font-family: sans-serif; font-size: 14px; font-weight: normal; = margin: 0; margin-bottom: 15px"><code>--inplace</code> / <code>-i</code> wr= ites formatted output back to the source file instead of stdout, preserving= the original file permissions. It takes multiple files:</p> <p style=3D"font-family: sans-serif; font-size: 14px; font-weight: normal; = margin: 0; margin-bottom: 15px"><code>pgfmt -i query1.sql query2.sql</code>= </p> <h1 style=3D"color: #000; font-family: sans-serif; line-height: 1.4; margin= : 0; margin-bottom: 30px; font-size: 25px; font-weight: 300; text-align: ce= nter">pg_dump style</h1> <p style=3D"font-family: sans-serif; font-size: 14px; font-weight: normal; = margin: 0; margin-bottom: 15px"><code>pgfmt --style pg_dump</code> (aliases= <code>pgdump</code>, <code>postgres</code>) reproduces PostgreSQL's <code>= ruleutils.c</code> deparser layout, the output you get from <code>pg_get_vi= ewdef</code> and <code>pg_get_functiondef</code>. On genuine deparser outpu= t it is byte-idempotent: format a catalog dump and you get the same bytes b= ack. Useful for diffing migrations against what PostgreSQL actually stores.= </p> <h1 style=3D"color: #000; font-family: sans-serif; line-height: 1.4; margin= : 0; margin-bottom: 30px; font-size: 25px; font-weight: 300; text-align: ce= nter">Other improvements</h1> <p style=3D"font-family: sans-serif; font-size: 14px; font-weight: normal; = margin: 0; margin-bottom: 15px">The 2.1.x line also expanded formatting cov= erage across SQL and PL/pgSQL and fixed several correctness bugs, including= typed string literals <code>(INTERVAL '2 days')</code> that were previousl= y dropped. Catalog-dumped views and functions that used to fail now format cleanly. </p> <p style=3D"font-family: sans-serif; font-size: 14px; font-weight: normal; = margin: 0; margin-bottom: 15px"><a href=3D"https://github.com/gmr/pgfmt/rel= eases" style=3D"color: #3498db; text-decoration: underline">See the release= notes for the full list</a>.</p> </td> </tr> </table> </td> </tr> </table> <div class=3D"footer" style=3D"clear: both; Margin-top: 10px; t= ext-align: center; width: 100%;"> <table border=3D"0" cellpadding=3D"0" cellspacing=3D"0" style= =3D"border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt= ; width: 100%;"> <tr> <td class=3D"content-block" style=3D"font-family: sans-se= rif; vertical-align: top; padding-bottom: 10px; padding-top: 10px; font-siz= e: 12px; color: #999999; text-align: center;"> <span class=3D"apple-link" style=3D"color: #999999; fon= t-size: 12px; text-align: center;"> This email was sent to you from Gavin M. Roy. It was delivered on their beh= alf by the PostgreSQL project. Any questions about the content of the message shou= ld be sent to Gavin M. Roy. </span> <br><br> You were sent this email as a subscriber of the <em>pgsql-announce</em> mai= linglist, for the content tag Related Open Source. To unsubscribe from further emails, or change which emails you want to receive, please click th= e personal unsubscribe link that you can find in the headers of this email, or visit <a href=3D"https://lists.postgresql.org/unsubscribe/" style=3D"color: #3498= db; text-decoration: underline">https://lists.postgresql.org/unsubscribe/</= a>. </td> </tr> </table> </div> </div> </td> <td style=3D"font-family: sans-serif; font-size: 14px; vertical-ali= gn: top;"> </td> </tr> </table> </body> </html> --===============5442245339083268644==--