首页龙虾技能列表 › PostgreSQL Database — 技能工具

PostgreSQL Database — 技能工具

v1.0.0

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

1· 946·1 当前·1 累计
by @limoxt·MIT-0
下载技能包
License
MIT-0
最后更新
2026/4/9
安全扫描
VirusTotal
可疑
查看报告
OpenClaw
可疑
medium confidence
The skill mostly matches its stated PostgreSQL purpose, but there are metadata/instruction mismatches and a few implementation notes you should review before installing (credentials, backups, and required client tools).
评估建议
This skill appears to implement the PostgreSQL features it claims, but before installing: (1) note the registry metadata omits required PG environment variables — the scripts expect PGHOST/PGPORT/PGDATABASE/PGUSER/PGPASSWORD, so supply only a least-privileged DB user. (2) Ensure pg_dump/pg_restore and psycopg2 are installed on the host; the scripts use subprocess to call pg_dump and will fail if absent. (3) Backups are written to disk (backup_dir) — verify the directory, permissions, and retenti...
详细分析 ▾
用途与能力
The name/description, SKILL.md and included scripts all align with PostgreSQL tasks (query execution, schema export, backup/restore). However the registry metadata lists no required environment variables while the SKILL.md and scripts clearly expect PGHOST/PGPORT/PGDATABASE/PGUSER/PGPASSWORD — an inconsistency that should be resolved.
指令范围
Runtime instructions are scoped to database operations and reference running the included Python scripts and PostgreSQL tools (pg_dump/pg_restore). The scripts read environment variables, write backup files to disk, and execute SQL — they do not call external network endpoints or exfiltrate data. One small mismatch: SKILL.md mentions 'performance monitoring' but there is no dedicated monitoring script; monitoring would be performed via queries (EXPLAIN, pg_stat_*), which is supported via query.py but not separately implemented.
安装机制
No install spec is provided (instruction-only install), so nothing is downloaded or written by an installer. The package includes Python scripts; risk comes from executing them, but there is no remote install URL or archive to fetch.
凭证需求
The scripts legitimately require database connection credentials (PG* env vars). That access is proportionate to the stated purpose. The concern is the metadata omission of these env vars (metadata declares none), and the fact that PGPASSWORD is sensitive — you should only provide least-privilege credentials and verify where backups are stored and who can access them.
持久化与权限
The skill is not force-included (always: false) and does not request persistent system privileges or change other skills' configuration. Autonomous invocation is allowed (platform default) but not combined here with other red flags.
安装前注意事项
  1. note the registry metadata omits required PG environment variables — the scripts expect PGHOST/PGPORT/PGDATABASE/PGUSER/PGPASSWORD, so supply only a least-privileged DB user. (
  2. Ensure pg_dump/pg_restore and psycopg2 are installed on the host; the scripts use subprocess to call pg_dump and will fail if absent. (
  3. Backups are written to disk (backup_dir) — verify the directory, permissions, and retention policy so backups are not exposed. (
  4. Review the scripts yourself if you don't fully trust the source: they execute arbitrary SQL and run pg_restore/pg_dump, which can modify or drop data when run with sufficient privileges. (
  5. If you plan to allow the agent to invoke autonomously, restrict credentials and consider creating a dedicated read/backup role (avoid superuser) to limit blast radius.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/2/28

Initial release: PostgreSQL database operations including query execution, schema export, and backup functionality

● 可疑

安装命令 点击复制

官方npx clawhub@latest install postgres-db
镜像加速npx clawhub@latest install postgres-db --registry https://cn.clawhub-mirror.com

技能文档

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
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务