Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>pgfmtNew to Visual Studio Code? Get it now.
pgfmt

pgfmt

sirmspencer

| (0) | Free
Format PostgreSQL files with pgfmt
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

pgfmt for VS Code

Formats PostgreSQL .sql files with pgfmt, so that every editor on a team produces the same output. The pgfmt executable is bundled with the extension; nothing else needs to be installed.

Usage

Run Format Document on a .sql file, or turn on format on save:

"[sql]": {
  "editor.defaultFormatter": "sirmspencer.pgfmt",
  "editor.formatOnSave": true
}

A syntax error leaves the document unchanged and shows pgfmt's message. pgfmt runs from the file's folder, so the nearest .pgfmt.json in that folder or a parent folder sets its options. The rules describe the default style and every setting.

Settings

  • pgfmt.path: path to a pgfmt executable to use instead of the bundled one, for example a development build.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft