backup-and-recovery

Manage PostgreSQL base backups, WAL archiving, and point-in-time recovery.

Updated Jun 1, 2026
One-click install
npx skills add https://github.com/matejformanek/postgres-claude --skill backup-and-recovery-matejformanek
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backup-and-recovery
Source: https://github.com/matejformanek/postgres-claude/tree/main/.claude/skills/backup-and-recovery
Command: npx skills add https://github.com/matejformanek/postgres-claude --skill backup-and-recovery-matejformanek

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill resolves the complexity of managing PostgreSQL data durability, ensuring you can reliably perform base backups, manage WAL archiving, and execute precise point-in-time recovery without data loss.

Core Features & Use Cases

  • Backup Orchestration: Automates base backup procedures including server-side target management and incremental backup strategies for PG 17+.
  • Recovery Management: Provides authoritative guidance on PITR targets, timeline switching, and restore_command semantics.
  • Use Case: When a production database suffers a logical error, use this skill to identify the exact LSN or timestamp for recovery and configure the startup process to restore the cluster to a consistent state.

Quick Start

Use the backup-and-recovery skill to generate a recovery plan for a point-in-time restoration to a specific timestamp.

Frequently Asked Questions about backup-and-recovery

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I perform a point-in-time recovery in PostgreSQL to restore data after a logical error?

PostgreSQL point-in-time recovery restores a cluster by replaying WAL segments up to a specific LSN or timestamp, requiring base backup configuration and recovery target setup to prevent data loss after logical errors.

What is WAL archiving and when do I need it for database backups?

WAL archiving captures continuous transaction logs in PostgreSQL, enabling crash recovery and point-in-time restoration when backups must preserve all committed transactions up to a precise failure point rather than just the last base backup state.

How to configure restore_command and recovery targets for PostgreSQL PITR operations?

Configuring PostgreSQL PITR involves setting restore_command to fetch archived WAL files and specifying recovery targets like LSN or timestamp, ensuring the cluster startup process replays WAL segments to restore to a consistent state.

Does PostgreSQL 17 support incremental base backups?

PostgreSQL 17 supports incremental base backup strategies, allowing server-side backup drivers to manage target storage efficiently by reducing the data volume needed for subsequent backups during orchestration.

Why does PostgreSQL timeline switching matter during point-in-time recovery?

PostgreSQL timeline switching during PITR prevents WAL corruption when a recovered server generates new WAL segments, ensuring recovery target configuration maintains cluster consistency and avoids overwriting original WAL history.