<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>pgBadger 13.2 Documentation on PIG.CENTER</title><link>https://pig.center/docs/pgbadger/</link><description>Recent content in pgBadger 13.2 Documentation on PIG.CENTER</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 08 Sep 2026 21:29:01 +0800</lastBuildDate><atom:link href="https://pig.center/docs/pgbadger/index.xml" rel="self" type="application/rss+xml"/><item><title>Download and Installation</title><link>https://pig.center/docs/pgbadger/download/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pig.center/docs/pgbadger/download/</guid><description>&lt;h2 id="distribution-channels"&gt;Choose a distribution channel&#10;&lt;/h2&gt;&#10;&lt;div class="td-table-scroll td-table-scroll--static"&gt;&#10;&lt;table&gt;&#10; &lt;thead&gt;&#10; &lt;tr&gt;&#10; &lt;th scope="col"&gt;Channel&lt;/th&gt;&#10; &lt;th scope="col"&gt;Use it for&lt;/th&gt;&#10; &lt;th scope="col"&gt;Location&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Official release&lt;/td&gt;&#10; &lt;td&gt;Source tarballs and release notes&lt;/td&gt;&#10; &lt;td&gt;&lt;a href="https://github.com/darold/pgbadger/releases"&gt;GitHub Releases&lt;/a&gt;&#10;&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;RPM package&lt;/td&gt;&#10; &lt;td&gt;RPM-based Linux distributions&lt;/td&gt;&#10; &lt;td&gt;&lt;a href="https://yum.postgresql.org/packages/"&gt;PostgreSQL Yum Repository&lt;/a&gt;&#10;&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Debian/Ubuntu package&lt;/td&gt;&#10; &lt;td&gt;APT-based Linux distributions&lt;/td&gt;&#10; &lt;td&gt;&lt;a href="https://wiki.postgresql.org/wiki/Apt"&gt;PostgreSQL Apt Repository&lt;/a&gt;&#10;&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Development source&lt;/td&gt;&#10; &lt;td&gt;Current unreleased code&lt;/td&gt;&#10; &lt;td&gt;&lt;a href="https://github.com/darold/pgbadger"&gt;darold/pgbadger&lt;/a&gt;&#10;&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;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.&lt;/p&gt;</description></item><item><title>Command-Line Reference</title><link>https://pig.center/docs/pgbadger/command-line/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pig.center/docs/pgbadger/command-line/</guid><description>&lt;p&gt;This page preserves the command reference generated from the pinned upstream source. Option names and help text remain verbatim so they can be compared directly with &lt;code&gt;pgbadger --help&lt;/code&gt;.&lt;/p&gt;&#10;&lt;h2 id="usage-and-options"&gt;Usage and options&#10;&lt;/h2&gt;&#10;&lt;p&gt;Usage: pgbadger [options] logfile [&amp;hellip;]&lt;/p&gt;&#10;&lt;div class="td-code td-code--untitled" id="td-code-94f7536e-fence-0" data-td-code data-td-code-auto-id&#10; data-td-language="text" data-td-line-count="1"&gt;&#10; &lt;div class="td-code__viewport" id="td-code-94f7536e-fence-0-viewport" data-td-code-viewport&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;PostgreSQL log analyzer with fully detailed reports and graphs.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;Arguments:&lt;/p&gt;&#10;&lt;div class="td-code td-code--untitled" id="td-code-94f7536e-fence-1" data-td-code data-td-code-auto-id&#10; data-td-language="text" data-td-line-count="3"&gt;&#10; &lt;div class="td-code__viewport" id="td-code-94f7536e-fence-1-viewport" data-td-code-viewport&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;logfile can be a single log file, a list of files, or a shell command&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;returning a list of files. If you want to pass log content from stdin&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;use - as filename. Note that input from stdin will not work with csvlog.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;Options:&lt;/p&gt;</description></item><item><title>PostgreSQL Logging Configuration</title><link>https://pig.center/docs/pgbadger/postgresql-logging/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pig.center/docs/pgbadger/postgresql-logging/</guid><description>&lt;p&gt;pgBadger can only report information that PostgreSQL writes to the log. Start with a parseable prefix and a deliberate statement-logging policy, then add the operational events you want to analyze.&lt;/p&gt;&#10;&lt;h2 id="minimum-query-logging"&gt;Minimum query logging&#10;&lt;/h2&gt;&#10;&lt;p&gt;To include query text and duration, enable duration-based statement logging:&lt;/p&gt;&#10;&lt;div class="td-code td-code--untitled" id="td-code-03eeee76-fence-0" data-td-code data-td-code-auto-id&#10; data-td-language="postgresql" data-td-line-count="1"&gt;&#10; &lt;div class="td-code__viewport" id="td-code-03eeee76-fence-0-viewport" data-td-code-viewport&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-postgresql" data-lang="postgresql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;log_min_duration_statement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;&lt;code&gt;0&lt;/code&gt; logs every completed statement. On a busy server, choose a higher threshold in milliseconds to control log volume. Measure the overhead and storage growth before enabling a low threshold in production.&lt;/p&gt;</description></item><item><title>Parallel Processing</title><link>https://pig.center/docs/pgbadger/parallel-processing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pig.center/docs/pgbadger/parallel-processing/</guid><description>&lt;p&gt;pgBadger has two complementary multiprocessing modes. Choose according to the shape of the input, not simply the number of CPUs.&lt;/p&gt;&#10;&lt;div class="td-table-scroll td-table-scroll--static"&gt;&#10;&lt;table&gt;&#10; &lt;thead&gt;&#10; &lt;tr&gt;&#10; &lt;th scope="col"&gt;Option&lt;/th&gt;&#10; &lt;th scope="col"&gt;Parallel unit&lt;/th&gt;&#10; &lt;th scope="col"&gt;Best fit&lt;/th&gt;&#10; &lt;th scope="col"&gt;Main constraint&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;&lt;code&gt;-j N&lt;/code&gt; / &lt;code&gt;--jobs N&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;chunks of one log file&lt;/td&gt;&#10; &lt;td&gt;one large, seekable log&lt;/td&gt;&#10; &lt;td&gt;chunk boundaries can duplicate or omit a small number of queries&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;&lt;code&gt;-J N&lt;/code&gt; / &lt;code&gt;--Jobs N&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;whole log files&lt;/td&gt;&#10; &lt;td&gt;many independent logs&lt;/td&gt;&#10; &lt;td&gt;useful only when enough files are available to keep workers busy&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;h2 id="single-file-jobs"&gt;Split one large file with &lt;code&gt;-j&lt;/code&gt;&#10;&lt;/h2&gt;&#10;&lt;div class="td-code td-code--untitled" id="td-code-e117b40b-fence-0" data-td-code data-td-code-auto-id&#10; data-td-language="console" data-td-line-count="1"&gt;&#10; &lt;div class="td-code__viewport" id="td-code-e117b40b-fence-0-viewport" data-td-code-viewport&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; pgbadger -j &lt;span class="m"&gt;8&lt;/span&gt; /var/log/postgresql/postgresql.log&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;The upstream algorithm divides each file into &lt;code&gt;N&lt;/code&gt; byte ranges, forks one parser per range, writes temporary binary statistics, then merges those statistics into the final report.&lt;/p&gt;</description></item><item><title>Incremental Reports</title><link>https://pig.center/docs/pgbadger/incremental-reports/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pig.center/docs/pgbadger/incremental-reports/</guid><description>&lt;p&gt;Incremental mode stores parsed statistics in binary form, then builds one HTML report per day, a cumulative report per week, and a calendar-style index linking them together. It is intended for repeated processing of rotated logs without counting the same entries again.&lt;/p&gt;&#10;&lt;h2 id="daily-and-weekly"&gt;Build daily and weekly reports&#10;&lt;/h2&gt;&#10;&lt;p&gt;Run pgBadger after the daily log rotation and provide a persistent output directory:&lt;/p&gt;&#10;&lt;div class="td-code td-code--titled" id="td-code-187415c9-fence-0" data-td-code data-td-code-auto-id&#10; data-td-language="cron" data-td-line-count="1" role="group" aria-labelledby="td-code-187415c9-fence-0-title"&gt;&#10; &lt;div class="td-code__header"&gt;&#10; &lt;span class="td-code__filename" id="td-code-187415c9-fence-0-title" title="crontab"&gt;crontab&lt;/span&gt;&#10; &lt;/div&gt;&#10; &lt;div class="td-code__viewport" id="td-code-187415c9-fence-0-viewport" data-td-code-viewport&gt;&lt;pre tabindex="0"&gt;&lt;code class="language-cron" data-lang="cron"&gt;0 4 * * * /usr/bin/pgbadger -I -q /var/log/postgresql/postgresql.log.1 -O /var/www/pg_reports/&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;&lt;code&gt;-I&lt;/code&gt; enables incremental mode and &lt;code&gt;-O&lt;/code&gt; selects the directory that holds the binary state, calendar index, and generated reports. pgBadger maintains its own incremental state in that directory, so &lt;code&gt;--last-parsed&lt;/code&gt; is unnecessary unless you deliberately want the state file elsewhere.&lt;/p&gt;</description></item><item><title>Output Formats</title><link>https://pig.center/docs/pgbadger/output-formats/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pig.center/docs/pgbadger/output-formats/</guid><description>&lt;p&gt;pgBadger selects output from the filename extension or from &lt;code&gt;-x&lt;/code&gt; / &lt;code&gt;--extension&lt;/code&gt;. Use &lt;code&gt;-o&lt;/code&gt; / &lt;code&gt;--outfile&lt;/code&gt; more than once to create multiple formats from the same parse.&lt;/p&gt;&#10;&lt;div class="td-table-scroll td-table-scroll--static"&gt;&#10;&lt;table&gt;&#10; &lt;thead&gt;&#10; &lt;tr&gt;&#10; &lt;th scope="col"&gt;Format&lt;/th&gt;&#10; &lt;th scope="col"&gt;Typical extension&lt;/th&gt;&#10; &lt;th scope="col"&gt;Best use&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;HTML&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;.html&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;interactive, human-readable report with charts&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Text&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;.txt&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;terminal review and plain archival output&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Binary&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;.bin&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;mergeable intermediate statistics and report rebuilds&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;JSON&lt;/td&gt;&#10; &lt;td&gt;&lt;code&gt;.json&lt;/code&gt;&lt;/td&gt;&#10; &lt;td&gt;integration with other software; requires &lt;code&gt;JSON::XS&lt;/code&gt;&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Raw CSV&lt;/td&gt;&#10; &lt;td&gt;chosen output file&lt;/td&gt;&#10; &lt;td&gt;row-oriented extraction with &lt;code&gt;--dump-raw-csv&lt;/code&gt;&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;h2 id="html-and-text"&gt;HTML and text&#10;&lt;/h2&gt;&#10;&lt;p&gt;The default output is &lt;code&gt;out.html&lt;/code&gt;:&lt;/p&gt;</description></item><item><title>Sample Reports</title><link>https://pig.center/docs/pgbadger/sample-reports/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pig.center/docs/pgbadger/sample-reports/</guid><description>&lt;p&gt;The example content was generated by pgBadger 11.8 in May 2022. The original examples are stored with this site, so report navigation, charts, styles, and scripts remain available without reaching the upstream server.&lt;/p&gt;&#10;&lt;div class="td-table-scroll td-table-scroll--static"&gt;&#10;&lt;table&gt;&#10; &lt;thead&gt;&#10; &lt;tr&gt;&#10; &lt;th scope="col"&gt;Example&lt;/th&gt;&#10; &lt;th scope="col"&gt;What it demonstrates&lt;/th&gt;&#10; &lt;th scope="col"&gt;Local copy&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Complete report&lt;/td&gt;&#10; &lt;td&gt;PostgreSQL activity together with PgBouncer statistics&lt;/td&gt;&#10; &lt;td&gt;&lt;a href="https://pig.center/third_party/pgbadger/examples/sample.html"&gt;Open the complete report&lt;/a&gt;&#10;&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Incremental report&lt;/td&gt;&#10; &lt;td&gt;Calendar index, weekly aggregation, and daily pages&lt;/td&gt;&#10; &lt;td&gt;&lt;a href="https://pig.center/third_party/pgbadger/examples/report/index.html"&gt;Open the incremental index&lt;/a&gt;&#10;&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Errors and events&lt;/td&gt;&#10; &lt;td&gt;A report restricted to errors and operational events&lt;/td&gt;&#10; &lt;td&gt;&lt;a href="https://pig.center/third_party/pgbadger/examples/errors.html"&gt;Open the error report&lt;/a&gt;&#10;&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;h2 id="complete-report"&gt;Complete report&#10;&lt;/h2&gt;&#10;&lt;p&gt;The complete report is a self-contained HTML document. Use its top navigation to inspect global statistics, queries, sessions, connections, temporary files, checkpoints, autovacuum activity, locks, and PgBouncer-specific charts.&lt;/p&gt;</description></item><item><title>Support and Contributing</title><link>https://pig.center/docs/pgbadger/support/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pig.center/docs/pgbadger/support/</guid><description>&lt;p&gt;pgBadger is maintained as an open project. Bug reports, feature proposals, documentation fixes, and patches are handled through the upstream GitHub repository.&lt;/p&gt;&#10;&lt;h2 id="bugs-and-features"&gt;Bugs and feature requests&#10;&lt;/h2&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Upgrade to the newest released version and confirm the behavior still occurs.&lt;/li&gt;&#10;&lt;li&gt;Search &lt;a href="https://github.com/darold/pgbadger/issues"&gt;open issues&lt;/a&gt;&#10; and &lt;a href="https://github.com/darold/pgbadger/issues?q=is%3Aissue&amp;#43;is%3Aclosed"&gt;closed issues&lt;/a&gt;&#10; for an existing answer.&lt;/li&gt;&#10;&lt;li&gt;Reduce the problem to the smallest safe log sample and command line that still reproduces it.&lt;/li&gt;&#10;&lt;li&gt;Remove credentials, sensitive SQL, bind values, host names, addresses, and business data.&lt;/li&gt;&#10;&lt;li&gt;Open a &lt;a href="https://github.com/darold/pgbadger/issues/new"&gt;new issue&lt;/a&gt;&#10; with the pgBadger version, operating system, input format, exact options, observed result, and expected result.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;For crashes or parser mistakes, include only the minimum sanitized log lines needed to reproduce the boundary. A complete production log or generated report is rarely appropriate for a public issue.&lt;/p&gt;</description></item><item><title>License and Credits</title><link>https://pig.center/docs/pgbadger/license/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://pig.center/docs/pgbadger/license/</guid><description>&lt;p&gt;pgBadger is free and open-source software distributed under the PostgreSQL License. It may be used, copied, modified, and distributed without a fee, subject to retaining the copyright and license notices.&lt;/p&gt;&#10;&lt;h2 id="postgresql-license"&gt;PostgreSQL License&#10;&lt;/h2&gt;&#10;&lt;p&gt;Copyright (c) 2012-2026, Gilles Darold&lt;/p&gt;&#10;&lt;p&gt;Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.&lt;/p&gt;</description></item></channel></rss>