postgresql-query

Execute SQL queries, manage schemas, and perform data operations using PostgreSQL at {{POSTGRES_HOST}}:{{POSTGRES_PORT}}.

54 stars

Best use case

postgresql-query is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Execute SQL queries, manage schemas, and perform data operations using PostgreSQL at {{POSTGRES_HOST}}:{{POSTGRES_PORT}}.

Teams using postgresql-query should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/postgresql-query/SKILL.md --create-dirs "https://raw.githubusercontent.com/bidewio/better-openclaw/main/skills/postgresql-query/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/postgresql-query/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How postgresql-query Compares

Feature / Agentpostgresql-queryStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Execute SQL queries, manage schemas, and perform data operations using PostgreSQL at {{POSTGRES_HOST}}:{{POSTGRES_PORT}}.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# PostgreSQL Query

PostgreSQL is available at `{{POSTGRES_HOST}}:{{POSTGRES_PORT}}` within the Docker network.

## Running SQL Queries

```bash
# 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

```bash
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

```bash
# 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 `\dt` to list tables, `\d table_name` to describe a table schema.
- Use transactions (`BEGIN; ... COMMIT;`) for multi-step operations.
- Use `EXPLAIN ANALYZE` to understand query performance.
- The pgvector extension enables vector similarity search.

Related Skills

supabase-query

54
from bidewio/better-openclaw

Interact with Supabase for database, auth, and storage

prometheus-query

54
from bidewio/better-openclaw

Query metrics and set up alerts using Prometheus at {{PROMETHEUS_HOST}}:{{PROMETHEUS_PORT}}.

llamaindex-query

54
from bidewio/better-openclaw

Build data-connected LLM applications with LlamaIndex

graphql-query

54
from bidewio/better-openclaw

Query GraphQL APIs using curl.

gemini-cli-query

54
from bidewio/better-openclaw

Query Google Gemini models via the Gemini CLI.

youtube-growth

54
from bidewio/better-openclaw

Act as an expert YouTube Strategy Consultant. Apply the Creator Unlock N.I.C.E.R. Framework for conducting channel audits, niche validation, and data-backed video ideation/thumbnail generation.

xyops-automate

54
from bidewio/better-openclaw

Build and manage automation pipelines using xyOps at {{XYOPS_HOST}}:{{XYOPS_PORT}}.

xml-parse

54
from bidewio/better-openclaw

Parse and transform XML/HTML documents using command-line tools in the shared volume at {{SHARED_VOLUME}}.

woodpecker-ci

54
from bidewio/better-openclaw

Lightweight container-native CI/CD with Woodpecker

whisper-transcribe

54
from bidewio/better-openclaw

Transcribe audio and video files to text using the Whisper speech-to-text API at {{WHISPER_HOST}}:{{WHISPER_PORT}}.

web-interface-guidelines

54
from bidewio/better-openclaw

Checklist for reviewing UI code for compliance with comprehensive web interface, accessibility, performance, and content guidelines — based on Vercel's Web Interface Guidelines.

web-design-reviewer

54
from bidewio/better-openclaw

Inspect web interfaces for layout, responsive, accessibility, and visual issues, then apply targeted source code fixes and re-verify results.