postgres-container-ops

postgres-container-ops is a skill for Claude Code from fmflurry/settings-opencode. It costs 151 tokens per session (4,373 once invoked), scanned A, original, MIT.

A runbook for operating a PostgreSQL database in a Docker container. It covers storage volumes, shared memory, health checks, image versions, and major-version upgrades.

In plain words
What is it for?
Use it to audit persistent storage, inspect container settings, tune readiness checks, pin PostgreSQL image versions, and plan upgrades.
Why use it?
It reduces the risk of losing database files or applying an unsafe container or version change.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to audit persistent storage, inspect container settings, tune readiness checks, pin PostgreSQL image versions, and plan upgrades.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fmflurry/settings-opencode/postgres-container-ops
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add fmflurry/settings-opencode --skill postgres-container-ops
Clone the repo
git clone --depth 1 https://github.com/fmflurry/settings-opencode

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-container-ops

README.md
[![agentmods](https://agentmods.dev/badge/skills/fmflurry/settings-opencode/postgres-container-ops/github.svg)](https://agentmods.dev/skills/fmflurry/settings-opencode/postgres-container-ops)
Your own site
<a href="https://agentmods.dev/skills/fmflurry/settings-opencode/postgres-container-ops"><img src="https://agentmods.dev/badge/skills/fmflurry/settings-opencode/postgres-container-ops/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-container-ops

Your own site · 80×15
<a href="https://agentmods.dev/skills/fmflurry/settings-opencode/postgres-container-ops"><img src="https://agentmods.dev/badge/skills/fmflurry/settings-opencode/postgres-container-ops.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 151 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,373 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.00151 $0.04373
Opus 5.5 $0.00060 $0.01749
Sonnet 5.5 $0.00030 $0.00875
Haiku 4.5 $0.00015 $0.00437

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

Security

Grade A, and why

postgres-container-ops 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-container-ops/SKILL.md · 243 lines

How it starts

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

PostgreSQL Container Operations

Target version: postgres:16-alpine — this repository's gc-platform-postgres container (db gcplatform, owner role gcplatform, data on named volume postgres-data → /var/lib/postgresql/data). The second Postgres, gc-platform-langfuse-postgres (Langfuse observability tier), is out of scope for this skill unless explicitly asked.

Contract: auditing is read-only (docker volume inspect, docker inspect, docker ps, pg_isready). Every upgrade, dump/restore, volume, or server-config command below is emitted ONLY as a ⚠️ HUMAN CONFIRMATION REQUIRED block — the postgres-dba agent never executes upgrades, restores, or config changes. Image-layout facts marked (verified) are confirmed against the official docker-library postgres README; facts marked ⚠️ are established guidance to verify before acting.

Source of truth for image behaviour: https://github.com/docker-library/docs/blob/master/postgres/README.md (verified). pg_upgrade mechanics: https://www.postgresql.org/docs/current/pgupgrade.html ⚠️.

Connection / inspection:

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

1. Volume persistence audit

Where the data physically lives is the single most important container fact. Get it wrong and a container re-create silently loses the database.

# Named volume + its host mountpoint:
docker volume inspect postgres-data

# What is actually mounted inside the container, and where:
docker inspect --format '{{range .Mounts}}{{.Type}} {{.Name}} -> {{.Destination}}{{println}}{{end}}' gc-platform-postgres

# Restart-survival probe (read-only): the data dir must be on the named volume, not an anonymous one:
docker inspect --format '{{range .Mounts}}{{if eq .Destination "/var/lib/postgresql/data"}}{{.Name}} ({{.Type}}){{end}}{{end}}' gc-platform-postgres

Interpretation:

  • PG ≤ 17 (this repo, on 16): the image declares its VOLUME at /var/lib/postgresql/data, and PGDATA defaults there. The data volume must be mounted at /var/lib/postgresql/data. (verified) Mounting at /var/lib/postgresql on PG ≤ 17 WILL NOT PERSIST data: the runtime auto-creates an anonymous volume at the declared path and data is written there instead, lost on container deletion. (verified)
  • PG18+ layout change (matters for any 16→18 upgrade plan): from PostgreSQL 18 the image makes PGDATA version-specific — /var/lib/postgresql/<major>/docker (e.g. /var/lib/postgresql/18/docker) — and moves the declared VOLUME up to /var/lib/postgresql. Mounts/volumes must target the new location. (verified) This is precisely what enables the fast pg_upgrade --link path (see §5): old and new data directories coexist under one mounted /var/lib/postgresql. (verified)
  • Opt-in early: you can adopt the PG18 layout on 16/17 by setting PGDATA explicitly (PGDATA=/var/lib/postgresql/17/docker) and mounting the volume at /var/lib/postgresql — but to migrate pre-existing data you must first move all database files into a <PG_MAJOR>/docker subdirectory of the volume. (verified) Treat that move as a mutation (human-only, with a fresh backup).
  • Anonymous volume or bind-mount into the repo tree = CRITICAL. Anonymous volumes vanish with docker compose down; repo-tree bind-mounts corrupt on macOS Docker file-sharing. docker volume rm postgres-data is on the postgres-dba never-execute list — deletion is a human decision taken with a verified backup in hand.

Read the full file on GitHub · 243 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 · 243 lines · 151 tokens per session scan A 3e0c863ec2a9

Subscribe to this mod's changes

postgres-container-ops is a skill published in the GitHub repository fmflurry/settings-opencode (171 stars, last pushed yesterday), licensed MIT. It adds 151 tokens to every session and 4,373 once invoked, about $0.0006 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