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

Sih.AI Photo Changer

AI图片生成与编辑工具,使用Sih.AI API进行自然语言驱动的图片处理。支持换装、换背景、换脸、风格转换(动漫/粘土/油画等)、美颜修图等功能。当用户需要通过自然语言描述来编辑图片(如"把衣服换成bikini"、"背景换成海边"、"转换成动漫风格")时使用此skill。

Registry SourceRecently Updated
General

股票分析

股票综合分析,融合基本面分析、技术分析、量化与行为金融分析三大体系,为投资者提供多维度的选股和择时建议。当用户询问某只股票(给出股票代码或名称)、市场整体情况、个股看法、能否买入/卖出、选股建议时使用此技能。

Registry SourceRecently Updated
General

daily-report-bian

自动生成并在指定时间通过飞书推送每日研究进展报告,内容涵盖今日进展、延续项目、明日计划及系统状态,字数不超1000字。

Registry SourceRecently Updated
General

Recipe Create Shared Drive

Create a Google Shared Drive and add members with appropriate roles.

Registry SourceRecently Updated