Skip to content

sodiqscript111/pg-cleanse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pg-cleanse

A CLI tool for inspecting PostgreSQL database health issues.

What It Detects

Blocked Queries - Queries waiting on locks held by other processes. These cause performance bottlenecks and application timeouts.

Zombie Transactions - Connections stuck in "idle in transaction" state. These hold locks, prevent vacuum from reclaiming space, and can lead to table bloat.

Dead Rows - Tables with high dead tuple counts from UPDATE/DELETE operations. Excessive dead rows slow down queries and waste storage until VACUUM runs.

Installation

go build -o pginspect .

Configuration

Set the following environment variables:

DB_HOST     - Database host (default: localhost)
DB_PORT     - Database port (default: 5432)
DB_USER     - Database user (required)
DB_PASSWORD - Database password
DB_NAME     - Database name (required)
DB_SSLMODE  - SSL mode (default: disable)

Usage

# Check for blocked queries
./pginspect blocked

# Check for zombie transactions
./pginspect zombie

# Check for dead rows
./pginspect dead

# Check for dead rows exceeding a threshold
./pginspect dead --threshold 10

Each command exits with status code 1 if issues are found.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages