A collection of practical PostgreSQL and PL/pgSQL scripts, checklists and patterns for database-heavy backend development.
This repository focuses on real-world database work:
- database health checks
- PL/pgSQL function patterns
- performance troubleshooting
- migration safety
- indexing and table size overview
- backend/database integration
The goal is not to provide magic scripts.
The goal is to make investigation, maintenance and database development safer and more repeatable.
scripts/00-environment-info- PostgreSQL and database metadatascripts/01-health-checks- table sizes, indexes, constraints and schema overviewscripts/02-performance-diagnostics- blocking sessions and long-running transactionsscripts/03-plpgsql-patterns- reusable PL/pgSQL templatesdocs- migration and function review checklists
This repository contains generic examples and templates only.
No customer-specific or company-internal code is included.
Use these scripts carefully.
Read them before running them.
Production databases do not forgive copy-paste heroism.