- Home
- Skills
- Data & Databases
- PostgreSQL Backup and Restore Drill with PITR Proof
Works with the AI Agents you already use
PostgreSQL Backup and Restore Drill with PITR Proof
Prove your Postgres backups restore: audit pg_dump, WAL/PITR, pgBackRest or RDS backups, run a timed restore to a scratch instance, measure real RPO and RTO.
$5
PostgreSQL Backup and Restore Drill with PITR Proof
Example session with this skill installed
We run Postgres 16 on a VM with nightly pg_dump to S3 via cron. We think we're fine. Can you check, and tell me how long a restore would take? DB is about 80 GB.
- Read your context and instructions
- Compiled the postgresql backup
Postgres backup drill: prod-db — VERDICT: AT RISK
Source: PostgreSQL 16.4, 82 GB, self-hosted VM ·
Targets: not defined (you said "lose at most an hour" → RPO 1 h)
Backups found
| Method | Schedule | Last success | Location | Encrypted | Off-site | Retention |
|---|---|---|---|---|---|---|
| pg_dump -Fc | nightly 02:00 | 11 days ago | S3 same account | SSE-S3 | no | 7 days (lifecycle) |
| WAL archiving | none | — | — | — | — | — |
Gaps
| # | Severity | Gap | Fix |
|---|---|---|---|
| 1 | Critical | cron job fails since disk filled (pg_dump: error: could not write); no alert | move dump target off /, alert on missing S3 object |
| 2 | Critical | 7-day retention + 11 days of failures = no usable backup in S3 | keep 30 days; copy to a second account with object lock |
| 3 | High | No PITR: best case RPO is 24 h vs your 1 h | pgBackRest with WAL archiving to S3 |
| 4 | Medium | Roles not backed up | add pg_dumpall --globals-only |
Drill (from a fresh manual dump, to a scratch VM)
| Step | Duration |
|---|---|
pg_dump -Fd -j 8 | 14:10 |
| copy to scratch | 3:40 |
pg_restore -j 8 | 41:25 |
| checks (row counts, max(created_at), app queries) | 4:05 |
Measured RTO: 63 min. Restored data matched production at dump time; pg_amcheck clean.
Next
Fix 1 and 2 today. Then set up pgBackRest + WAL archiving and re-run this drill as a PITR to a chosen minute. Scratch VM restore-drill-1019 is still running: delete it?
Connects securely to your tools. The creator never sees your data.
About this skill
Most teams have backups. Few have restored one. The first real test usually happens during an outage, and that is when people find the dump is empty, WAL archiving failed three weeks ago, roles were never backed up, or the restore takes six hours instead of thirty minutes.
This skill gives your coding agent a drill procedure and a reference file checked against the PostgreSQL docs. It:
- Inventories every backup:
pg_dump,pg_basebackup, WAL archiving, pgBackRest, Barman, WAL-G, PostgreSQL 17+ incremental backups, and managed backups on RDS, Aurora, Cloud SQL, Azure, Supabase and Neon - Finds gaps before you need them: stale or failed backups, WAL archive failures, no encryption, no copy outside the production account, short retention, missing roles/globals, no alerts
- Runs a timed restore drill to a scratch instance: full restore, point-in-time recovery to a chosen moment, or a single table
- Checks the restored data: connections, row counts, newest timestamps, extensions,
amcheck, app queries - Measures real RPO and RTO and compares them with your targets
- Writes a step-by-step restore runbook from what actually worked
- Returns a verdict: RESTORABLE, UNTESTED or AT RISK
Who it is for: founders and small teams running Postgres in production, platform engineers, and anyone answering a SOC 2 or customer security questionnaire about backups.
Safety: never restores over, drops or reconfigures production. Production access is read-only, restores go to a clearly named scratch target, and restored copies are treated as production data and deleted with your yes.
Honesty note: RESTORABLE is only given after a restore actually ran and the data checked out.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.
Cannot bypass network restrictions or IAM blocks. Requires a scratch instance for drills. Does not handle non-Postgres data like external files or OS-level configs.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 29 days ago
- Software
- PostgreSQL client toolsScratch instanceor
Docker
The client tools are pg_dump, pg_restore and psql. The scratch instance or Docker is for the restore.