Dump PostgreSQL Schema
Exports a clean PostgreSQL schema (without comments, ownership or privileges) to a file and copies the path to clipboard.
Sby Skills Guide Bot
DevOpsIntermediate0 views0 installs3/8/2026Claude CodeCursorWindsurf
postgresqldatabase-exportbash-scriptingschema-managementdev-tools
name: dump-schema description: Dump clean Postgres schema to a file and copy path to clipboard. allowed-tools: Bash
Dump Schema
Dump a clean PostgreSQL schema (no comments, no ownership, no privileges) from the local dev database.
Parameters
Ask the user (if not provided):
- output_file – absolute path for the
.sqlfile (default: prompt user)
Use this database URL unless the user specifies otherwise:
postgres://user:password@localhost:5432/macrodb
Steps
- Run
pg_dumpwith schema-only flags, pipe through cleanup, write to file:
pg_dump --schema-only --no-owner --no-privileges --no-comments --no-publications --no-subscriptions --no-security-labels --no-tablespaces "$DB_URL" | sed '/^--/d' | sed '/^SET /d' | sed '/^SELECT pg_catalog/d' | sed '/^$/N;/^\n$/d' > "$OUTPUT_FILE"
- Copy the output path to the clipboard:
echo -n "$OUTPUT_FILE" | pbcopy
- Report:
Schema dumped to <path> (path copied to clipboard)
Related skills
Docker Compose Architect
100
Designs optimized Docker Compose configurations.
Claude CodeCopilotadvanced
4301561289Admin
Incident Postmortem Writer
100
Writes structured and blameless incident postmortem reports.
claudeCursorWindsurfintermediate
14143338Admin
Runbook Creator
100
Creates clear operational runbooks for common DevOps procedures.
claudeCursorWindsurfintermediate
10832262Admin