pgFormatter
Input—per 1M tokens
Output—per 1M tokens
Context—tokens
WeightsClosed
About
pgFormatter is ranked #2 of 34 in code formatting tools on Inferse. It runs on API, Linux, Self-hosted, Web. There is a free plan.
Compared on code formatting tools
- Free plan
- Yesgithub.com
Facts
- Purpose
- pgFormatter beautifies PostgreSQL SQL queries and PL/pgSQL code, and supports keywords from several SQL standards as well as PostgreSQL-specific keywords.github.com · 30 Sept 2026
- Other databases
- The project says pgFormatter also works with other databases.github.com · 30 Sept 2026
- Ways to run
- It can run as a console program or a CGI application, producing text or HTML based on its environment.github.com · 30 Sept 2026
- Formatting options
- Options include changing keyword, function, identifier, and type case; adjusting indentation; wrapping queries; and choosing comma placement.github.com · 30 Sept 2026
- Anonymization
- The command line option --anonymize obscures query literals before formatting.github.com · 30 Sept 2026
- JSON API
- When called as a CGI application with an Accept: application/json header, pgFormatter can return a JSON response; the API can be disabled in its CGI configuration.github.com · 30 Sept 2026
- Online demo limit
- The README describes an online demo that limits SQL queries to ten thousand characters.github.com · 30 Sept 2026
- Installation
- The README documents installation from a GitHub source tarball using Perl Makefile.PL, make, and make install.github.com · 30 Sept 2026
- Docker
- The project documents building a Docker image and piping SQL input to a container running pgFormatter.github.com · 30 Sept 2026
- Editor integrations
- The README describes use with Vim and (Neo)Vim and links to Atom and Visual Studio Code integrations.github.com · 30 Sept 2026
- Pre-commit integration
- The README documents configuring pgFormatter as a pre-commit hook for SQL files.github.com · 30 Sept 2026
- Security and privacy
- The anonymization option is described as useful for hiding confidential data before formatting; the repository page opened did not state security certifications or compliance claims.github.com · 30 Sept 2026
- Support and limits
- The README notes that pgFormatter cannot detect user-defined functions or keywords for other databases automatically, but allows custom lists for them.github.com · 30 Sept 2026
- Maker and license
- The README credits Gilles Darold as the original author and says pgFormatter is free software distributed under the PostgreSQL Licence.github.com · 30 Sept 2026
Best pgFormatter alternatives
See all 12
7.3 autopep8 See plans price on the maker's page
7.2 Prettier Free free plan, no paid price published Free plan
6.0 Black Free free plan, no paid price published Free plan
6.0 clang-format See plans price on the maker's page
6.0 rustfmt Free free plan, no paid price published Free plan
5.9 Accessibility Test Framework for Android Free free plan, no paid price published Free plan Where it ranks on Inferse
Sources
- github.com/darold/pgformatter· checked 30 Sept 2026
