PostgreSQL Query
SkillDatabases & dataExecute SQL queries, manage schemas, and perform data operations using PostgreSQL at {{POSTGRES_HOST}}:{{POSTGRES_PORT}}.
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
Then ask your AI: use the PostgreSQL Query skill
What this skill tells your AI
The instructions your AI receives, as published by bidewio/better-openclaw in skills/postgresql-query/SKILL.md and read by ahel’s review.
PostgreSQL is available at {{POSTGRES_HOST}}:{{POSTGRES_PORT}} within the Docker network.
Running SQL Queries
# Execute a query
PGPASSWORD=$POSTGRES_PASSWORD psql -h {{POSTGRES_HOST}} -p {{POSTGRES_PORT}} -U {{POSTGRES_USER}} -d {{POSTGRES_DB}} \
-c "SELECT * FROM users LIMIT 10;"
# Execute from a SQL file
PGPASSWORD=$POSTGRES_PASSWORD psql -h {{POSTGRES_HOST}} -p {{POSTGRES_PORT}} -U {{POSTGRES_USER}} -d {{POSTGRES_DB}} \
-f /data/queries/report.sql
Creating Tables
PGPASSWORD=$POSTGRES_PASSWORD psql -h {{POSTGRES_HOST}} -p {{POSTGRES_PORT}} -U {{POSTGRES_USER}} -d {{POSTGRES_DB}} -c "
CREATE TABLE IF NOT EXISTS documents (
id SERIAL PRIMARY KEY,
title TEXT NOT NULL,
content TEXT,
embedding vector(384),
created_at TIMESTAMPTZ DEFAULT NOW()
);"
Importing and Exporting Data
# Export to CSV
PGPASSWORD=$POSTGRES_PASSWORD psql -h {{POSTGRES_HOST}} -p {{POSTGRES_PORT}} -U {{POSTGRES_USER}} -d {{POSTGRES_DB}} \
-c "\COPY (SELECT * FROM users) TO '/data/output/users.csv' WITH CSV HEADER"
# Import from CSV
PGPASSWORD=$POSTGRES_PASSWORD psql -h {{POSTGRES_HOST}} -p {{POSTGRES_PORT}} -U {{POSTGRES_USER}} -d {{POSTGRES_DB}} \
-c "\COPY users FROM '/data/input/users.csv' WITH CSV HEADER"
Tips for AI Agents
- Always use parameterized queries to prevent SQL injection.
- Use
\dtto list tables,\d table_nameto describe a table schema. - Use transactions (
BEGIN; ... COMMIT;) for multi-step operations. - Use
EXPLAIN ANALYZEto understand query performance. - The pgvector extension enables vector similarity search.
Signals
- GitHub stars
- 58
- Forks
- 6
- Last commit
- Aug 2026
Advanced
- Item type
- skill
- Key
postgresql-query- Source
- github.com/bidewio/better-openclaw
github.com/bidewio/better-openclaw
Related picks
Skill · asymmetric-al
The pick for Postgresdocker-agent-run
Skill · docker
The pick for Dockerdocker-sandbox
Skill · joelhooks
The pick for Dockerconnect
Skill · composiohq
More in Databases & dataanalytics
Skill · coreyhaines31
More in Databases & dataazure-kusto
Skill · microsoft
More in Databases & data