pg_roast

Opinionated PostgreSQL database auditor

Overview

PackageVersionCategoryLicenseLanguage
pg_roast1.0SECPostgreSQLC
IDExtensionBinLibLoadCreateTrustRelocSchema
7120pg_roastNoYesYesYesNoNoroast
Relatedpgaudit pg_auditor pg_permissions pgmemento table_log pgauditlogtofile set_user pg_snakeoil pg_readonly pg_command_fw

Upstream has no release tag; package pins main commit ccbf012. Manual audits work normally; the periodic background worker requires shared_preload_libraries=pg_roast.

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY1.01817161514pg_roast-
RPMPIGSTY1.01817161514pg_roast_$v-
DEBPIGSTY1.01817161514postgresql-$v-pg-roast-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
d12.aarch64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
d13.x86_64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
d13.aarch64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
u22.x86_64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
u22.aarch64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
u24.x86_64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
u24.aarch64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
u26.x86_64
u26.aarch64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0

Build

You can build the RPM / DEB packages for pg_roast using pig build:

pig build pkg pg_roast         # build RPM / DEB packages

Install

You can install pg_roast directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:

pig repo add pgsql -u          # Add repo and update cache

Install the extension using pig or apt/yum/dnf:

pig install pg_roast;          # Install for current active PG version
pig ext install -y pg_roast -v 18  # PG 18
pig ext install -y pg_roast -v 17  # PG 17
pig ext install -y pg_roast -v 16  # PG 16
pig ext install -y pg_roast -v 15  # PG 15
pig ext install -y pg_roast -v 14  # PG 14
dnf install -y pg_roast_18       # PG 18
dnf install -y pg_roast_17       # PG 17
dnf install -y pg_roast_16       # PG 16
dnf install -y pg_roast_15       # PG 15
dnf install -y pg_roast_14       # PG 14
apt install -y postgresql-18-pg-roast   # PG 18
apt install -y postgresql-17-pg-roast   # PG 17
apt install -y postgresql-16-pg-roast   # PG 16
apt install -y postgresql-15-pg-roast   # PG 15
apt install -y postgresql-14-pg-roast   # PG 14

Preload:

shared_preload_libraries = 'pg_roast';

Create Extension:

CREATE EXTENSION pg_roast;

Usage

Sources:

pg_roast runs opinionated PostgreSQL health checks and stores findings in its fixed roast schema. It checks configuration, schema design, indexes, vacuum and bloat indicators, security posture, replication, connections, and workload signals. Version 1.0 targets PostgreSQL 14 and later.

Manual audits

Manual mode does not require preloading:

CREATE EXTENSION pg_roast;

SELECT * FROM roast.run();
SELECT severity, check_name, object_name, roast
FROM roast.latest
ORDER BY severity, check_name;

SELECT * FROM roast.summary;

Each run persists audit history and findings. Use the latest view for the newest run and the summary view for grouped results.

Scheduled audits

The optional background worker requires preload configuration and a restart:

shared_preload_libraries = 'pg_roast'
pg_roast.database = 'mydb'
pg_roast.interval = 3600

The database setting is fixed at server start. Review the upstream settings before enabling automatic audits across a production workload.

Caveats

  • Findings are heuristic advice, not automatic proof of a defect. Review workload context, maintenance windows, and PostgreSQL documentation before applying any recommendation.
  • Audits execute catalog and statistics queries and write history tables. Measure overhead on large catalogs and protect the roast schema from untrusted users.
  • Results can expose object names, configuration, security findings, and query-related operational details. Apply least privilege and an explicit retention policy.
  • Preloading is unnecessary for manual runs but mandatory for the background worker; changing startup-only settings requires a restart.

Last Modified: 2026-07-30: extension update 2026-07-30 (7219c44)