postgres

postgres is a skill for Cursor from timescale/pg-aiguide. It costs 211 tokens per session (829 once invoked), scanned A, original, Apache-2.0.

A guide for designing and changing PostgreSQL databases, which store application data in tables. It covers table structure, data types, rules, indexes, migrations, search, geographic data, time-series data, and vector data used for meaning-based search.

In plain words
What is it for?
Use it to design schemas, constraints, indexes, partitions, extensions, migrations, full-text or vector search, geographic tables, and TimescaleDB time-series tables.
Why use it?
It helps choose suitable database structures and search methods before implementation. It also provides specialized guidance for spatial data, time-series workloads, and applications that search by both keywords and meaning.

Skill for Cursor

Written for Cursor: shipped in a Cursor plugin.

Part of the pg-aiguide plugin — 11 skills, 1 MCP server shipped together

▶ Claude + pg-aiguide The Free Tool That Gives Your LLM a Postgres PhD Tiger Data (creators of TimescaleDB) · about postgres · on YouTube →

Good fit Use it to design schemas, constraints, indexes, partitions, extensions, migrations, full-text or vector search, geographic tables, and TimescaleDB time-series tables.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/timescale/pg-aiguide/postgres
About the project

pg-aiguide is a knowledge and tooling project that gives AI coding assistants version-aware PostgreSQL documentation and curated database practices. Developers use it through agent skills, an MCP server, or a Claude Code plugin to help coding tools generate better PostgreSQL code. The catalogue entries are its skills, instructions, MCP integration, and rule.

timescale/pg-aiguide · 1,872 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add timescale/pg-aiguide --skill postgres
Clone the repo
git clone --depth 1 https://github.com/timescale/pg-aiguide

Made for: Cursor.

Or install pg-aiguide, the plugin that ships this one along with the rest of its 11 skills, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for postgres

README.md
[![agentmods](https://agentmods.dev/badge/skills/timescale/pg-aiguide/postgres/github.svg)](https://agentmods.dev/skills/timescale/pg-aiguide/postgres)
Your own site
<a href="https://agentmods.dev/skills/timescale/pg-aiguide/postgres"><img src="https://agentmods.dev/badge/skills/timescale/pg-aiguide/postgres/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for postgres

Your own site · 80×15
<a href="https://agentmods.dev/skills/timescale/pg-aiguide/postgres"><img src="https://agentmods.dev/badge/skills/timescale/pg-aiguide/postgres.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 211 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 829 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 25 Sept 2026
  • Snyk pass 25 Sept 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00211 $0.00829
Opus 5.5 $0.00084 $0.00332
Sonnet 5.5 $0.00042 $0.00166
Haiku 4.5 $0.00021 $0.00083

Measured 28d ago against content hash 6855e5cb7628, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

postgres scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 28d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/postgres/SKILL.md · 53 lines

How it starts

The opening of the file, as written. The whole thing — 53 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PostgreSQL Expert Skills

This skill provides comprehensive PostgreSQL expertise through specialized references. Load the appropriate reference based on the task.

Available References

Existing Databases

  • schema-exploration — Read-only, question-driven exploration of schemas, tables, views, routines, triggers, RLS, and extensions using pg_catalog. Use to understand an existing database before designing changes or writing queries.

Table Design

  • design-postgres-tables — Data types, constraints, indexes, JSONB patterns, partitioning, and PostgreSQL best practices. Use for any general table/schema design task.
  • design-postgis-tables — PostGIS spatial table design: geometry vs geography types, SRIDs, spatial indexing, and location-based query patterns. Use when the task involves geographic or spatial data.

Search

  • pgvector-semantic-search — Vector similarity search with pgvector: HNSW/IVFFlat indexes, halfvec storage, quantization, filtered search, and tuning. Use for embeddings, RAG, or semantic search.
  • postgres-hybrid-text-search — Hybrid search combining BM25 keyword search with pgvector semantic search using RRF. Use when combining keyword and meaning-based search.

TimescaleDB

  • setup-timescaledb-hypertables — Hypertable creation, compression, retention policies, continuous aggregates, and indexes. Use when setting up TimescaleDB from scratch.
  • find-hypertable-candidates — SQL queries to analyze existing tables and score them for hypertable conversion. Use when evaluating which tables to migrate.
  • migrate-postgres-tables-to-hypertables — Step-by-step migration: partition column selection, in-place vs blue-green, validation. Use when executing a migration.

Read the full file on GitHub · 53 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 28d ago Changed · +4 lines · +14 tokens per session 6855e5cb7628
  2. 1mo ago Changed · -4 lines · -13 tokens per session dec9bfef0591
  3. 1mo ago First seen · 53 lines · 210 tokens per session scan A 475d8725ed18

Subscribe to this mod's changes

postgres is a skill published in the GitHub repository timescale/pg-aiguide (1,872 stars, last pushed 2d ago), licensed Apache-2.0. It adds 211 tokens to every session and 829 once invoked, about $0.0008 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories