PostgreSQL Manager

Manage a shared PostgreSQL Docker container for local dev environments. Handles container lifecycle, database creation/removal, and cross-instance dumps via pg_dump. Joins the shared Docker network created by proxy-manager.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "PostgreSQL Manager" with this command: npx skills add pereirajair/postgres-manager

PostgreSQL Manager

Manages the shared PostgreSQL Docker container for local dev environments.

Architecture

postgres-manager/
├── docker-compose.yml   # PostgreSQL 16 Alpine container
└── run.sh               # lifecycle + db admin CLI

Joins the shared nginx-proxy_net network (created by proxy-manager) so app containers connect via hostname codai_postgres. Data is persisted in a named volume.

Commands

./run.sh start                    # start PostgreSQL container
./run.sh stop                     # stop container (data persists in volume)
./run.sh status                   # status + list databases
./run.sh wait                     # block until PostgreSQL is ready
./run.sh create-db <name>         # CREATE DATABASE (idempotent)
./run.sh drop-db <name>           # DROP DATABASE (interactive confirm)
./run.sh dump <src> <dest>        # pg_dump src | psql dest
./run.sh list-dbs                 # list all non-template databases
./run.sh psql [<db>]              # open psql interactive session

How to Execute Tasks

Start PostgreSQL for the first time

cd postgres-manager && ./run.sh start

On first run, Docker creates the volume and initializes codai_main.

Create a database for a new instance

./run.sh create-db codai_feature

Snapshot main database into a new instance

./run.sh dump codai_main codai_feature

Remove a worktree database

./run.sh drop-db codai_feature   # prompts for confirmation

Open interactive psql

./run.sh psql                    # connects to codai_main
./run.sh psql codai_feature      # connects to specific db

Startup Order

  1. proxy-manager start — creates the shared Docker network
  2. postgres-manager start — joins the shared network
  3. worktree-manager start <instance>

Configuration

VariableDefaultPurpose
POSTGRES_CONTAINERcodai_postgresContainer name
POSTGRES_USERcodaiDatabase user
POSTGRES_PASSWORDpgpassDatabase password
POSTGRES_MAIN_DBcodai_mainPrimary database name
POSTGRES_PORT5433Host port (maps to 5432)
CODAI_NETWORKnginx-proxy_netShared Docker network name

App Connection

Backend containers connect to PostgreSQL at:

  • Host: codai_postgres (container name on shared network)
  • Port: 5432
  • User: codai / Password: pgpass
  • DB: codai_main (or instance-specific db)

Rules

  • Never drop POSTGRES_MAIN_DB — it is the source of truth for snapshots.
  • drop-db always prompts for confirmation.
  • stop preserves data in the Docker volume.
  • Network is external: true — proxy-manager must start first.

Related Plugins

  • proxy-manager — creates the shared Docker network (start first)
  • mysql-manager — MySQL alternative
  • redis-manager — in-memory cache companion
  • worktree-manager — app instances that consume PostgreSQL

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

儿童危险行为识别分析工具

Detects climbing, playing with fire, touching power sources, and dangerous actions near windows, providing real-time alerts. It is suitable for child safety...

Registry SourceRecently Updated
Coding

Skill Oracle

Skill Oracle — Curated documentation of quality ClawHub skills. Markdown tables telling agents which tools work and which are empty. Not an API or code library.

Registry SourceRecently Updated
Coding

Suspicious Message Safety Check

Calmly analyze suspicious messages for risk signals without clicking links or sharing sensitive data, and guide safe verification steps while avoiding certai...

Registry SourceRecently Updated
Coding

Mysql Manager

Manage a shared MySQL Docker container for local dev environments. Handles container lifecycle, database creation/removal, and cross-instance data dumps. Des...

Registry SourceRecently Updated