Download and Installation

Official releases, packages, requirements, and source installation

Sources: official download section and the pinned upstream README.md.

Choose a distribution channel

Channel Use it for Location
Official release Source tarballs and release notes GitHub Releases
RPM package RPM-based Linux distributions PostgreSQL Yum Repository
Debian/Ubuntu package APT-based Linux distributions PostgreSQL Apt Repository
Development source Current unreleased code darold/pgbadger

The documentation snapshot in this site is based on the 13.2 source tree. Always check the release page before downloading: the local snapshot is intentionally fixed, while upstream releases continue to change.

Requirements

The HTML report path needs only:

  • a modern Perl distribution;
  • a web browser to render the embedded JavaScript charts.

Optional capabilities add the following dependencies:

Capability Dependency
Parse PostgreSQL CSV logs Text::CSV_XS
Write JSON output JSON::XS
Read .gz, .bz2, .lz4, .xz, .zip, or .zst input the matching zcat, bzcat, lz4cat, xz, unzip, or zstdcat utility

Install JSON support on Debian or Ubuntu:

CONSOLE
$ sudo apt-get install libjson-xs-perl

On an RPM-based system:

CONSOLE
$ sudo yum install perl-JSON-XS

Use --zcat to override a decompressor path. Supplying one custom command disables mixing different compressed formats in the same invocation.

Install from an official tarball

Download a release archive, then build and install it with Perl’s standard toolchain:

CONSOLE
$ tar xzf pgbadger-13.2.tar.gz
$ cd pgbadger-13.2
$ perl Makefile.PL
$ make
$ sudo make install

The default site layout installs the program as /usr/local/bin/pgbadger and the manual page as /usr/local/share/man/man1/pgbadger.1.

For a distribution-style installation under /usr, generate the Makefile with:

CONSOLE
$ perl Makefile.PL INSTALLDIRS=vendor
$ make
$ sudo make install

INSTALLDIRS=perl is another upstream-supported layout. Inspect the generated paths before installing into a managed system.

Install development code

CONSOLE
$ git clone https://github.com/darold/pgbadger.git
$ cd pgbadger
$ perl Makefile.PL
$ make
$ make test
$ sudo make install

Development code may contain changes not yet covered by a release note. Prefer a tagged archive for reproducible production packaging.

Verify the installation

CONSOLE
$ pgbadger --version
$ pgbadger --help

Continue with the command-line reference and PostgreSQL logging configuration.