PostgreSQL Query
SkillDatabases & dataExecute SQL queries, manage schemas, and perform data operations using PostgreSQL at {{POSTGRES_HOST}}:{{POSTGRES_PORT}}.
Use PostgreSQL Query in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add PostgreSQL Query and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the PostgreSQL Query skill
Details
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.
No other account needed.
Add Ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
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 · baekenough
The pick for Postgresanalytics
Skill · coreyhaines31
More in Databases & datasupabase
Skill · supabase
More in Databases & dataconnect
Skill · composiohq
More in Databases & dataazure-kusto
Skill · microsoft
More in Databases & datarevops
Skill · coreyhaines31
More in Databases & data