# darold/pgFormatter

A PostgreSQL SQL syntax beautifier that can work as a console program or as a CGI. On-line demo site at http://sqlformat.darold.net/

Repository: https://github.com/darold/pgFormatter
Canonical: https://ross.abutalabs.com/products/pgformatter
Language: PLpgSQL
License: PostgreSQL
License Family: other
Last push: 2026-08-15T16:08:59+00:00

## Health v2 (maintenance only)
Score: 84/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 97, release rhythm 59, longevity 100
- inputs: {"age_days": 5002, "days_push": 18, "days_rel": 116, "gap_med": 118.0, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1952, forks 119 (observed 2026-08-28T04:05:58.355277+00:00)

## What it is
pgFormatter is a PostgreSQL SQL syntax beautifier that reformats SQL and PL/pgSQL code according to SQL standards and PostgreSQL-specific keywords. It runs as a console program or CGI script, outputting text, HTML, or JSON.

## Use cases
- format messy SQL queries for readability
- beautify PL/pgSQL code from PostgreSQL
- standardize SQL formatting across a team
- anonymize literals in SQL before sharing queries
- serve an online SQL formatting service via CGI
- reformat SQL files in place from the command line

## When to choose
- you work with PostgreSQL or PL/pgSQL and need consistent SQL formatting
- you want a lightweight CLI formatter without a database connection
- you need to hide sensitive literals before formatting queries
- you want to embed SQL formatting in a web service

## When to avoid
- you need formatting for other SQL dialects with vendor-specific extensions beyond PostgreSQL
- you want an IDE-integrated formatter with live preview
- you need SQL linting or query validation, not just formatting

## Facets
- artifact type: cli-tool
- maturity: active
- function: formatter, cli, developer-tools
- domain: databases, developer-tools
- platform: cli, cross-platform
- tags: sql-formatter, postgresql, beautifier, plpgsql, cgi, command-line, web-server

## Member repositories
- darold/pgFormatter (main) score 84

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:58.355277+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:06:35.458811+00:00, confidence not recorded.
  - readme: https://github.com/darold/pgFormatter (fetched 2026-08-28T04:05:58.355277+00:00, sha 35aab6791170)
- Data as of 2026-08-30T08:39:29.467469+00:00.
