Query and analyze the Gertrude PostgreSQL database. Use when answering questions about database schema, writing SQL queries, analyzing data, or debugging database-related issues. Has read-only access via the 'readonly' user.
You have read-only access to the Gertrude PostgreSQL database for querying and analysis.
gertrudereadonlypsql -U readonly -d gertrudeThe database uses multiple schemas to organize tables:
# List all tables with their schemas
psql -U readonly -d gertrude -c "\dt"
# List all schemas with privileges
psql -U readonly -d gertrude -c "\dn+"
# Describe a specific table (show columns, types, constraints)
psql -U readonly -d gertrude -c "\d parent.parents"
psql -U readonly -d gertrude -c "\d+ parent.parents" # with more details
# List all columns in a schema
psql -U readonly -d gertrude -c "\d parent.*"
# Run a simple query
psql -U readonly -d gertrude -c "SELECT * FROM parent.parents LIMIT 10;"
# Run a formatted query with better output
psql -U readonly -d gertrude -c "SELECT id, email, created_at FROM parent.parents ORDER BY created_at DESC LIMIT 5;"
# Count records
psql -U readonly -d gertrude -c "SELECT COUNT(*) FROM parent.parents;"
# Complex queries with joins (example)
psql -U readonly -d gertrude -c "
SELECT p.email, COUNT(c.id) as num_children
FROM parent.parents p
LEFT JOIN parent.children c ON c.parent_id = p.id
GROUP BY p.email
LIMIT 10;
"
# Use expanded display for wide tables
psql -U readonly -d gertrude -c "\x" -c "SELECT * FROM parent.parents LIMIT 1;"
# Export to CSV
psql -U readonly -d gertrude -c "COPY (SELECT * FROM parent.parents LIMIT 10) TO STDOUT WITH CSV HEADER;"
\d commands to understand table structure before writing
queriesparent.parents, not just parents)psql -U readonly -d gertrude -c "SELECT COUNT(*) as total_parents FROM parent.parents;"
psql -U readonly -d gertrude -c "
SELECT id, event_type, detail, created_at
FROM system.security_events
ORDER BY created_at DESC
LIMIT 10;
"
psql -U readonly -d gertrude -c "\d parent.computers"
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer