pg_crash

Send random signals to random processes

Overview

PackageVersionCategoryLicenseLanguage
pg_crash1.0ADMINBSD 3-ClauseC
IDExtensionBinLibLoadCreateTrustRelocSchema
5210pg_crashNoYesYesNoNoNo-
Relatedpg_snakeoil pg_cheat_funcs pg_savior pg_dirtyread pg_surgery pg_repack pg_rewrite pg_squeeze

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY1.01817161514pg_crash-
RPMPIGSTY1.01817161514pg_crash_$v-
DEBPIGSTY1.01817161514postgresql-$v-pg-crash-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
PGDG 0.3
d12.aarch64
PGDG 0.3
d13.x86_64
PGDG 0.3
PGDG 0.3
PGDG 0.3
PGDG 0.3
PGDG 0.3
d13.aarch64
PGDG 0.3
PGDG 0.3
PGDG 0.3
PGDG 0.3
PGDG 0.3
u22.x86_64
PGDG 0.3
u22.aarch64
PGDG 0.3
u24.x86_64
PGDG 0.3
u24.aarch64
PGDG 0.3

Build

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

pig build pkg pg_crash         # build RPM / DEB packages

Install

You can install pg_crash 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_crash;          # Install for current active PG version
pig ext install -y pg_crash -v 18  # PG 18
pig ext install -y pg_crash -v 17  # PG 17
pig ext install -y pg_crash -v 16  # PG 16
pig ext install -y pg_crash -v 15  # PG 15
pig ext install -y pg_crash -v 14  # PG 14
dnf install -y pg_crash_18       # PG 18
dnf install -y pg_crash_17       # PG 17
dnf install -y pg_crash_16       # PG 16
dnf install -y pg_crash_15       # PG 15
dnf install -y pg_crash_14       # PG 14
apt install -y postgresql-18-pg-crash   # PG 18
apt install -y postgresql-17-pg-crash   # PG 17
apt install -y postgresql-16-pg-crash   # PG 16
apt install -y postgresql-15-pg-crash   # PG 15
apt install -y postgresql-14-pg-crash   # PG 14

Preload:

shared_preload_libraries = 'pg_crash';

Usage

pg_crash: Send random signals to random processes

pg_crash is a chaos engineering extension that periodically sends kill signals to PostgreSQL backend processes, useful for HA and failover testing. It must be added to shared_preload_libraries.

Configuration

Add to postgresql.conf:

shared_preload_libraries = 'pg_crash'

# POSIX signals to send (space-separated)
crash.signals = '1 2 3'

# Delay in seconds between sending signals
crash.delay = 30

Signal Reference

Common POSIX signals: 1 (SIGHUP), 2 (SIGINT), 3 (SIGQUIT), 9 (SIGKILL), 15 (SIGTERM).

After configuring, restart the server. The background worker will periodically send the configured signals to random backend processes at the specified interval.


Last Modified 2026-03-12: add pg extension catalog (95749bf)