# Postgres

> Postgres is an open-source agent skill for databases. Guides an agent through PostgreSQL schema design, indexing, search, TimescaleDB. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/timescale/pg-aiguide/tree/main/skills/postgres
- **Repository:** https://github.com/timescale/pg-aiguide
- **GitHub stars:** 1,892
- **License:** Apache-2.0
- **Skill name:** postgres
- **Collection:** https://github.com/timescale/pg-aiguide
- **Categories:** [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-12-04

## About

This skill acts as an entry point to a set of PostgreSQL reference guides. It routes the agent to the right guide depending on whether the task is exploring an existing database, designing tables, setting up vector or full-text search, using PostGIS for spatial data, working with TimescaleDB hypertables, or planning schema changes on production systems.

The skill works by pointing the agent at specific reference files, each covering a narrower area such as data types and constraints, pgvector HNSW or IVFFlat indexing, hybrid BM25 and vector search with reciprocal rank fusion, hypertable compression and retention, or DDL lock behavior and safe migration patterns. Several guides contain SQL patterns the agent can adapt. The skill itself ships no scripts.

The agent needs access to a PostgreSQL environment, and some workflows assume particular extensions such as pgvector, PostGIS or TimescaleDB are available. The skill is licensed under Apache-2.0 and is distributed through the aiguide Claude Code plugin marketplace.

## When your agent uses it

> Use this skill for any PostgreSQL database work — table design, indexing, data types, constraints, extensions (pgvector, PostGIS, TimescaleDB), search, and migrations. **Trigger when user asks to:** - Explore an existing PostgreSQL database to understand its objects and relationships - Design or modify PostgreSQL tables, schemas, or data models - Choose data types, constraints, indexes, or partitioning strategies - Work with pgvector embeddings, semantic search, or RAG - Set up full-text search, hybrid search, or BM25 ranking - Use PostGIS for spatial/geographic data - Set up TimescaleDB hypertables for time-series data - Migrate tables to hypertables or evaluate migration candidates - Plan or execute safe schema migrations with zero downtime **Keywords:** PostgreSQL, Postgres, SQL, schema, table design, indexes, constraints, pgvector, PostGIS, TimescaleDB, hypertable, semantic search, hybrid search, BM25, time-series, migration

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/timescale/pg-aiguide/tree/HEAD/skills/postgres)
- [License: Apache-2.0](https://github.com/timescale/pg-aiguide/tree/HEAD/skills/postgres)

## Features

- **Existing database exploration:** Read-only, question-driven inspection of schemas, tables, views, triggers, RLS and extensions via pg_catalog.
- **Table and index design:** Guidance on data types, constraints, indexes, JSONB patterns and partitioning strategies.
- **Vector and hybrid search:** Covers pgvector HNSW and IVFFlat indexes, quantization, and combining BM25 with semantic search.
- **Spatial data modeling:** Covers geometry versus geography types, SRIDs, spatial indexing and location queries with PostGIS.
- **TimescaleDB hypertables:** Covers hypertable setup, compression, retention policies, continuous aggregates and candidate analysis.
- **Zero-downtime migrations:** Covers DDL lock behavior, timeout strategies, rollback planning and fork-based testing.

## Good for

- Design a normalized schema for a new orders database
- Add an HNSW index for semantic search over embeddings
- Convert a time-series table into a TimescaleDB hypertable
- Plan a column change on a production table without downtime
- Explore an unfamiliar database to map its tables and relationships

## Install

### Claude Code

This skill ships in the `pg` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add timescale/pg-aiguide
/plugin install pg@aiguide
```

Or copy only this skill to `~/.claude/skills/postgres`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/timescale/pg-aiguide.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/postgres &&
cp -R "$tmp/skills/postgres" ~/.claude/skills/postgres &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/postgres` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/postgres` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/timescale/pg-aiguide.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/postgres &&
cp -R "$tmp/skills/postgres" ~/.agents/skills/postgres &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/postgres` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/postgres` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/timescale/pg-aiguide.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/postgres &&
cp -R "$tmp/skills/postgres" ~/.cursor/skills/postgres &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/postgres` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/timescale/pg-aiguide.git --path skills/postgres
```

Or copy the folder to `~/.gemini/skills/postgres` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/postgres`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/timescale/pg-aiguide.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/postgres &&
cp -R "$tmp/skills/postgres" ~/.copilot/skills/postgres &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/postgres` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/timescale/pg-aiguide.git
```

Then copy `pg-aiguide/skills/postgres` into your agent's skills folder as `postgres`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What triggers Postgres?

It is meant for any PostgreSQL database work, including table design, indexing, data types, constraints, extensions such as pgvector, PostGIS and TimescaleDB, search, and migrations.

### Does Postgres run scripts or change my database?

The skill contains no scripts. Its guides describe read-only exploration and SQL patterns the agent can apply.

### Which extensions are covered?

The guides cover pgvector, PostGIS and TimescaleDB, along with BM25-style keyword ranking for full-text search.

### How do I install Postgres in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/postgres to use it in all your projects, or to .claude/skills/postgres in one project. Or install the pg plugin, which includes it: /plugin marketplace add timescale/pg-aiguide, then /plugin install pg@aiguide.

### Does Postgres run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Postgres?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Postgres?

The closest alternatives to Postgres are Design postgres tables, PostgreSQL optimization, Design postgis tables, Postgres database migration and Database migrations.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Design postgres tables](https://ai-powered.com/skills/design-postgres-tables): Design postgres tables is an open-source agent skill for databases.
- [PostgreSQL optimization](https://ai-powered.com/skills/postgresql-optimization): PostgreSQL optimization is an open-source agent skill for databases.
- [Design postgis tables](https://ai-powered.com/skills/design-postgis-tables): Design postgis tables is an open-source agent skill for databases.
- [Postgres database migration](https://ai-powered.com/skills/postgres-database-migration): Postgres database migration is an open-source agent skill for databases.
- [Database migrations](https://ai-powered.com/skills/database-migrations): Database migrations is an open-source agent skill for databases.
- [Migrate postgres tables to hypertables](https://ai-powered.com/skills/migrate-postgres-tables-to-hypertables): Migrate postgres tables to hypertables is an open-source agent skill for databases.
- [Find hypertable candidates](https://ai-powered.com/skills/find-hypertable-candidates): Find hypertable candidates is an open-source agent skill for databases.
- [Pgvector semantic search](https://ai-powered.com/skills/pgvector-semantic-search): Pgvector semantic search is an open-source agent skill for databases.

---
Source: https://ai-powered.com/skills/postgres-timescale
