بنقرة واحدة
postgres
Comprehensive PostgreSQL management: queries, backups, user management, and performance analysis.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Comprehensive PostgreSQL management: queries, backups, user management, and performance analysis.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Essential file system operations.
Common Git version control operations.
Upload, download, and edit files on remote servers via NAVIG
Summarize web pages, articles, YouTube videos, and documents using AI
Query and manage databases on remote servers via NAVIG
Check GitHub repos, CI status, PRs, and issues using the gh CLI
| name | postgres |
| description | Comprehensive PostgreSQL management: queries, backups, user management, and performance analysis. |
| metadata | {"navig":{"emoji":"🐘","requires":{"bins":["psql"]}}} |
Manage PostgreSQL databases, users, and performance directly from the command line. This skill leverages psql for complex operations and navig db for simpler tasks.
# List databases (using navig primitive)
navig db list
# List tables in a specific database
navig db tables -d my_database
# Get database size
navig db query "SELECT pg_size_pretty(pg_database_size('my_database'));" -d postgres --plain
Use navig db query with base64 encoding for complex SQL (especially multi-line or with special characters).
Pattern:
$sql = "SELECT count(*) FROM users WHERE created_at > NOW() - INTERVAL '7 days';"
$b64 = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($sql))
navig db query --b64 $b64 -d my_database --plain
# Create a new user (role)
navig db query "CREATE USER app_user WITH PASSWORD 'secure_password';" -d postgres # pragma: allowlist secret
# Grant permissions
navig db query "GRANT ALL PRIVILEGES ON DATABASE my_database TO app_user;" -d postgres
check active queries to debug slow performance.
# Show currently running queries
navig db query "SELECT pid, age(query_start, clock_timestamp()), usename, query FROM pg_stat_activity WHERE state != 'idle' AND query NOT LIKE '%pg_stat_activity%' ORDER BY query_start desc;" -d postgres --plain
# Run vacuum analyze (reclaims storage and updates stats)
# Note: This can be resource intensive!
navig db query "VACUUM ANALYZE;" -d my_database
# Dump to a compressed file
navig db dump my_database -o /tmp/backup.sql.gz
Warning: This is destructive!
# Restore from file
navig db restore /tmp/backup.sql.gz -d my_database
--plain: Always use the plain output flag when parsing results or feeding them into another tool.BEGIN; ... COMMIT; (execute as a single block).LIMIT clause to prevent flooding the output.