Skip to content
pg_crash

pg_crash

pg_crash : Send random signals to random processes

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
5210
pg_crash
pg_crash
1.0
ADMIN
BSD 3-Clause
C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--sL---
No
Yes
Yes
No
no
no
Relationships
See Also
pg_snakeoil
pg_cheat_funcs
pg_savior
pg_dirtyread
pg_surgery
pg_repack
pg_rewrite
pg_squeeze

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXT
PIGSTY
1.0
18
17
16
15
14
pg_crash-
RPM
PIGSTY
1.0
18
17
16
15
14
pg_crash_$v-
DEB
PIGSTY
1.0
18
17
16
15
14
postgresql-$v-pg-crash-
Linux / PGPG18PG17PG16PG15PG14
el8.x86_64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
el8.aarch64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
el9.x86_64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
el9.aarch64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
el10.x86_64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
el10.aarch64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
d12.x86_64
PGDG 0.3
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
d12.aarch64
PGDG 0.3
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
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
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
u22.aarch64
PGDG 0.3
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
u24.x86_64
PGDG 0.3
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
u24.aarch64
PGDG 0.3
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
u26.x86_64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
u26.aarch64
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PIGSTY 1.0
PackageVersionOSORGSIZEFile URL
pg_crash_181.0el8.x86_64pigsty13.0 KiBpg_crash_18-1.0-1PIGSTY.el8.x86_64.rpm
pg_crash_181.0el8.aarch64pigsty13.2 KiBpg_crash_18-1.0-1PIGSTY.el8.aarch64.rpm
pg_crash_181.0el9.x86_64pigsty13.0 KiBpg_crash_18-1.0-1PIGSTY.el9.x86_64.rpm
pg_crash_181.0el9.aarch64pigsty12.9 KiBpg_crash_18-1.0-1PIGSTY.el9.aarch64.rpm
pg_crash_181.0el10.x86_64pigsty13.0 KiBpg_crash_18-1.0-1PIGSTY.el10.x86_64.rpm
pg_crash_181.0el10.aarch64pigsty13.2 KiBpg_crash_18-1.0-1PIGSTY.el10.aarch64.rpm
postgresql-18-pg-crash0.3d12.x86_64pgdg12.7 KiBpostgresql-18-pg-crash_0.3-2.pgdg12+1_amd64.deb
postgresql-18-pg-crash0.3d12.aarch64pgdg12.8 KiBpostgresql-18-pg-crash_0.3-2.pgdg12+1_arm64.deb
postgresql-18-pg-crash0.3d13.x86_64pgdg12.8 KiBpostgresql-18-pg-crash_0.3-2.pgdg13+1_amd64.deb
postgresql-18-pg-crash0.3d13.aarch64pgdg13.0 KiBpostgresql-18-pg-crash_0.3-2.pgdg13+1_arm64.deb
postgresql-18-pg-crash0.3u22.x86_64pgdg12.7 KiBpostgresql-18-pg-crash_0.3-2.pgdg22.04+1_amd64.deb
postgresql-18-pg-crash0.3u22.aarch64pgdg12.8 KiBpostgresql-18-pg-crash_0.3-2.pgdg22.04+1_arm64.deb
postgresql-18-pg-crash0.3u24.x86_64pgdg12.8 KiBpostgresql-18-pg-crash_0.3-2.pgdg24.04+1_amd64.deb
postgresql-18-pg-crash0.3u24.aarch64pgdg13.0 KiBpostgresql-18-pg-crash_0.3-2.pgdg24.04+1_arm64.deb
postgresql-18-pg-crash1.0u26.x86_64pigsty13.2 KiBpostgresql-18-pg-crash_1.0-1PIGSTY~resolute_amd64.deb
postgresql-18-pg-crash0.3u26.x86_64pgdg13.0 KiBpostgresql-18-pg-crash_0.3-2.pgdg26.04+1_amd64.deb
postgresql-18-pg-crash1.0u26.aarch64pigsty13.2 KiBpostgresql-18-pg-crash_1.0-1PIGSTY~resolute_arm64.deb
postgresql-18-pg-crash0.3u26.aarch64pgdg13.0 KiBpostgresql-18-pg-crash_0.3-2.pgdg26.04+1_arm64.deb

Source

pig build pkg pg_crash;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

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

Install this extension with pig:

pig install pg_crash;		# install via package name, for the active PG version

pig install pg_crash -v 18;   # install for PG 18
pig install pg_crash -v 17;   # install for PG 17
pig install pg_crash -v 16;   # install for PG 16
pig install pg_crash -v 15;   # install for PG 15
pig install pg_crash -v 14;   # install for PG 14

Config this extension to shared_preload_libraries:

shared_preload_libraries = 'pg_crash';

This extension does not need CREATE EXTENSION DDL command

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 updated on