postgres-backup-restore

postgres-backup-restore is a skill for Claude Code from fmflurry/settings-opencode. It costs 113 tokens per session (2,308 once invoked), scanned A, original, MIT.

A PostgreSQL backup and restore playbook for a database running in Docker. PostgreSQL is a relational database, and Docker runs the database in a managed container.

In plain words
What is it for?
Use it for logical dumps, cluster-role backups, write-ahead-log archiving, point-in-time recovery, and restore drills for the PostgreSQL 16 instance.
Why use it?
It documents safe ways to copy database data, restore it, and recover to an earlier point, while keeping destructive operations for a human to run.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is docker cp gc-platform-postgres:/tmp/gcplatform_$(date +%F).dump ./backups/.

Good fit Use it for logical dumps, cluster-role backups, write-ahead-log archiving, point-in-time recovery, and restore drills for the PostgreSQL 16 instance.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/fmflurry/settings-opencode
agentmods
npx agentmods add skills/fmflurry/settings-opencode/postgres-backup-restore

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for postgres-backup-restore

README.md
[![agentmods](https://agentmods.dev/badge/skills/fmflurry/settings-opencode/postgres-backup-restore/github.svg)](https://agentmods.dev/skills/fmflurry/settings-opencode/postgres-backup-restore)
Your own site
<a href="https://agentmods.dev/skills/fmflurry/settings-opencode/postgres-backup-restore"><img src="https://agentmods.dev/badge/skills/fmflurry/settings-opencode/postgres-backup-restore/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for postgres-backup-restore

Your own site · 80×15
<a href="https://agentmods.dev/skills/fmflurry/settings-opencode/postgres-backup-restore"><img src="https://agentmods.dev/badge/skills/fmflurry/settings-opencode/postgres-backup-restore.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 113 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,308 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00113 $0.02308
Opus 5.5 $0.00045 $0.00923
Sonnet 5.5 $0.00023 $0.00462
Haiku 4.5 $0.00011 $0.00231

Measured 27d ago against content hash e6dbd990d194, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

postgres-backup-restore scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 27d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/postgres-backup-restore/SKILL.md · 178 lines

How it starts

The opening of the file, as written. The whole thing — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PostgreSQL Backup & Restore

Target version: postgres:16-alpine — this repository's gc-platform-postgres container (db gcplatform, owner role gcplatform, data on named volume postgres-data).

Contract: auditing is read-only (SHOW, pg_stat_archiver, docker volume inspect). Every backup/restore/ config command below is emitted ONLY as a ⚠️ HUMAN CONFIRMATION REQUIRED block — the postgres-dba agent never executes backups, restores, or server-config changes. Restores are ALWAYS human-executed: a restore overwrites data and is irreversible in the wrong hands.

Connection:

docker exec gc-platform-postgres psql -U gcplatform -d gcplatform -c "<query>"

1. Backup strategy map (pick per need)

Method Captures PITR? Notes for this repo
pg_dump -Fc One database, logical (SQL-level) NO Restores into any PG version ≥ source; slow on huge DBs; does NOT capture roles/tablespaces
pg_dumpall --globals-only Cluster globals: roles, tablespaces NO Needed separately — gc_kourou_app_login, gc_kourou_identity_app, gc_kourou_identity_migrator are global objects (though this repo re-provisions them via migrations on boot)
pg_basebackup Physical whole-cluster copy Base for PITR Must stop/quiet writes for a consistent snapshot unless using WAL archiving; docker volume makes this awkward
WAL archiving + base backup Continuous, point-in-time YES Requires archive_mode=on + working archive_command (see §3)
PG16 native incremental backup — — NOT AVAILABLE: pg_basebackup --incremental is PostgreSQL 17+ only. On PG16, "incremental" = WAL archiving layered on periodic base backups.

pg_dump can never do PITR — it is a logical snapshot at dump time.


2. Logical backup recipes (docker instance)

⚠️ HUMAN CONFIRMATION REQUIRED

# Database dump, custom format (compressed, parallel-restoreable, selective):
docker exec gc-platform-postgres pg_dump -U gcplatform -d gcplatform -Fc -f /tmp/gcplatform_$(date +%F).dump
docker cp gc-platform-postgres:/tmp/gcplatform_$(date +%F).dump ./backups/

# Plain-SQL alternative (readable in git/diff, no parallel restore):
docker exec gc-platform-postgres pg_dump -U gcplatform -d gcplatform -f - > ./backups/gcplatform_$(date +%F).sql

# Cluster globals (roles!) — not included in pg_dump:
docker exec gc-platform-postgres pg_dumpall -U gcplatform --globals-only -f - > ./backups/globals_$(date +%F).sql

Read the full file on GitHub · 178 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 27d ago First seen · 178 lines · 113 tokens per session scan A e6dbd990d194

Subscribe to this mod's changes

postgres-backup-restore is a skill published in the GitHub repository fmflurry/settings-opencode (171 stars, last pushed yesterday), licensed MIT. It adds 113 tokens to every session and 2,308 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-20.

Related

Other skills, from other repositories

polar-local-environment

This skill should be used when setting up or managing Polar local development environment with Docker.

fcakyon/claude-codex-settings · 22 tokens

cnpg

Create and operate CloudNativePG (CNPG) Postgres databases on Kubernetes the GitOps/Flux way - on managed cloud (GKE + GCS via Workload Identity) OR self-hosted (K3s/bare-metal + any S3-compatible store via a credentials secret). Covers Cluster + ScheduledBackup manifests, barman WAL archiving, pgvector, PITR…

vanducng/skills · 155 tokens

postgres-operator-cloudnative-pg-migration

Migrate PostgreSQL clusters from the Zalando postgres-operator (acid.zalan.do postgresql CRs, Spilo/Patroni, WAL-G) to CloudNativePG (CNPG) on Kubernetes, incl. fully air-gapped clusters. Core knowledge: the two walls (Spilo↔CNPG glibc/collation divergence that corrupts physically-copied indexes; WAL-G↔Barman archive…

air-gapped/skills · 224 tokens

alloydb-omni-container

You're an expert in AlloyDB Omni running in a container. You can help users with related tasks such as starting, stopping, listing, connecting to AlloyDB Omni instance running in a container, and querying for logs.

gemini-cli-extensions/alloydb-omni · 51 tokens

express-prisma-coolify-image

Package an Express and Prisma API as a runtime-only image that migrates its Postgres database at start. Use when containerising a Node API with a database, or when migrations, readiness or shutdown misbehave in production.

KhaledSaeed18/dotclaude · 53 tokens

docker-dev-environment

Use when setting up local development services or running the project locally. Establishes the "stateful services in Docker, app runs native" pattern with Postgres, Redis, MinIO, and Mailpit.

martian56/claude-engineer · 46 tokens