postgres-db

PostgreSQL 数据库操作技能。用于执行SQL查询、表管理、备份恢复、性能监控等数据库操作。触发条件:用户提到 PostgreSQL、postgres、数据库查询、SQL查询、表结构、数据库备份等。

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 "postgres-db" with this command: npx skills add limoxt/postgres-db

PostgreSQL Database Skill

Overview

This skill provides comprehensive PostgreSQL database operations including query execution, schema management, backup/restore, and performance monitoring.

Capabilities

1. SQL Query Execution (scripts/query.py)

Execute SQL queries against PostgreSQL databases with support for:

  • SELECT queries with result formatting
  • INSERT/UPDATE/DELETE operations
  • Transaction support
  • Query result export (JSON, CSV)

2. Schema Export (scripts/schema_export.py)

Export database schema information:

  • Table structures (columns, types, constraints)
  • Indexes and foreign keys
  • Views and triggers
  • Export to JSON/Markdown format

3. Database Backup (scripts/backup.py)

Database backup and restore operations:

  • Full database backup using pg_dump
  • Table-specific backup
  • Point-in-time recovery support
  • Backup rotation management

4. Performance Monitoring

Monitor database performance:

  • Query execution plans (EXPLAIN ANALYZE)
  • Index usage statistics
  • Table size and row counts
  • Connection pool status

Usage

Query Database

python scripts/query.py --dbname mydb --query "SELECT * FROM users LIMIT 10"

Export Schema

python scripts/schema_export.py --dbname mydb --output schema.json

Backup Database

python scripts/backup.py --dbname mydb --backup-dir /backups

Requirements

  • PostgreSQL client tools (psql, pg_dump)
  • Python 3.7+
  • psycopg2 or asyncpg library

Configuration

Set environment variables:

  • PGHOST - Database host
  • PGPORT - Database port (default: 5432)
  • PGDATABASE - Database name
  • PGUSER - Database user
  • PGPASSWORD - Database password

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.

General

RedotPay Payment Skill for MPP

Use this skill when the user wants to call an API, discover available services, or access external data with automatic payments using RedotPay — or mentions...

Registry SourceRecently Updated
General

Founder Signal

Founder Signal turns verified Reddit evidence into a small, reviewable signal package for founders evaluating product demand and positioning across one or mo...

Registry SourceRecently Updated
General

PM周报数据同步

将项目经理提交的原始 Excel 周报数据同步到乐荐飞书表格。当项目经理发送周报 Excel 文件、要求更新周收入数据、核对周报数据时激活。

Registry SourceRecently Updated
General

Bybit Exchange AI Trading Skill

Bybit Exchange Trading Skill — trade on Bybit using natural language. Covers spot, derivatives, earn, and more. Requires Bybit API credentials and explicit c...

Registry SourceRecently Updated