← All extensions

pgfmt

v0.4.0 · by middle-management · added 3 November 2026

PostgreSQL SQL formatting and diagnostics via pgfmt-lsp

Language servers

How to install

With Forge Super installed, the button above opens the app on this extension, where you press Install. Nothing is installed until you do.

You can also open the Extensions panel in the app and search for pgfmt. The extension's id is pgfmt-lsp.

Don't have Forge Super yet? Download it here.

README

From the extension's repository, written by its authors and not by Mentenaz. See the source.

pgfmt for Zed

A Zed extension that provides PostgreSQL SQL formatting and diagnostics via pgfmt-lsp.

Features

  • Formatting — format SQL files on demand or automatically on save
  • Diagnostics — SQL parse errors shown inline as you type

Installation

Install the extension from the Zed extension registry:

  1. Open the command palette (cmd+shift+p)
  2. Run Extensions: Install Extension
  3. Search for pgfmt and install it

The pgfmt-lsp binary is downloaded automatically from GitHub Releases for your platform — no manual installation required.

Configuration

Format on save

Add this to your Zed settings (cmd+,) or your project's .zed/settings.json:

{
  "languages": {
    "SQL": {
      "formatter": "language_server",
      "format_on_save": "on"
    }
  }
}

Custom binary path

If you'd prefer to manage pgfmt-lsp yourself (e.g. via go install or a version manager like mise), you can point the extension at your own binary and bypass the auto-download entirely:

{
  "lsp": {
    "pgfmt-lsp": {
      "binary": {
        "path": "/Users/you/go/bin/pgfmt-lsp"
      }
    }
  }
}

Install the binary manually with:

go install github.com/middle-management/pgfmt/cmd/pgfmt-lsp@latest

Note: Zed does not inherit your shell's $PATH, so tools managed by mise, asdf, or similar may not be found automatically. Use an absolute path in the binary.path setting if the LSP fails to start.

Binary resolution order

When no explicit binary.path is configured, the extension resolves the binary as follows:

  1. pgfmt-lsp on the system PATH (useful during local development)
  2. A previously-downloaded binary cached in the extension directory
  3. Downloaded from the latest GitHub Release for your platform

Supported platforms

OSArchitecture
macOSarm64 (Apple Silicon)
macOSamd64 (Intel)
Linuxamd64
Linuxarm64

Contributing

See the pgfmt repository for source code, issue tracking, and contribution guidelines.