AI Skill for PostgreSQL AI skill by KissMySkills, cover
What's inside the AI Skill for PostgreSQL AI skill: Query tuning, Schema design, Index review, Migration checks
How the AI Skill for PostgreSQL AI skill works in three steps: download, drop it into your AI chat, done
The AI Skill for PostgreSQL AI skill works with Claude, ChatGPT, Gemini and any AI chat, 30-day money-back guarantee

AI Skill for PostgreSQL

Your AI works as a senior PostgreSQL practitioner who reads an EXPLAIN plan, picks the index, and writes migrations that…

$19· one file, yours to keep

Yours to keep · instant download

Subscribe · $12/mo

7 days free, then $12/mo · cancel anytime

  • Visa
  • Mastercard
  • American Express
  • Apple Pay

30-day money-back · secure checkout by Stripe

Read the opening lines
# AI Skill for PostgreSQL
KissMySkills.com | Install: paste this whole file into Claude Projects (Project instructions), a custom GPT (Instructions), a Gemini Gem, or your AI's system prompt. Then just ask questions the way you normally would.

## Who you are
You are a senior PostgreSQL practitioner embedded in the user's daily development and database work, with thousands of queries, pragmatic schemas and production clusters behind you. You optimise for correct SQL that uses indexes, schemas that stay consistent under load, and safe changes to live databases. Tone: direct, practical, step-by-step when needed.

## What you know about PostgreSQL
- Core objects: schemas, tables, constraints (PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK, NOT NULL), identity columns, views, materialized views, functions, triggers, extensions, roles.
- Data types: bigint, numeric, text, boolean, timestamptz, interval, uuid, jsonb, arrays, enum, range types.
- SQL features: CTEs including RECURSIVE, window functions (ROW_NUMBER, RANK, LAG, LEAD), LATERAL joins, DISTINCT ON, FILTER, RETURNING, INSERT ON CONFLICT, generated columns, full text search with tsvector.
- jsonb: ->, ->>, @>, ?, jsonb_set, jsonb_build_object, jsonb_path_query, GIN indexes.
- Indexes: B-tree, composite indexes and column order, partial, expression, covering with INCLUDE, GIN, GiST, BRIN, unique, CREATE INDEX CONCURRENTLY, bloat.

Prompt set · 77 lines · the first 12 shown

How it works

  1. Buy or subscribeAdd it to your cart for $19 and the file is yours to keep. Or subscribe: every file in the store, $12/mo.
  2. Open in your AIOpen the file, copy a prompt and paste it into Claude, ChatGPT or any AI chat. Subscribers connect their AI once instead:

    Claude

    Anthropic's AI chat, on the web, desktop and phone · about 3 minutes

    Works on every Claude plan, Free included.

    • Team or Enterprise plan: the workspace owner adds it once in Organization settings, then everyone clicks Connect.
    • Nothing happens when you click Connect? Allow pop-ups for claude.ai and try again.

    On a phone? Set it up once on a computer. It then shows up in the Claude phone app by itself. Email me the link

    After you buy a file
    1. Download your .skill file from the order email or your account.

    2. In Claude, turn on code execution in Settings › Capabilities, then go to Customize › Skills › + › Create skill › Upload a skill.

    3. Start a new chat and ask for the specialist by name.

    Open full guide

  3. Ask by nameAsk your AI for AI Skill for PostgreSQL by name, or fill in the parts in brackets and send.

What's inside

  • ai-skill-for-postgresql.txtPrompt set · 77 lines · instant download
  • SQL with CTEs, window functions, DISTINCT ON and ON CONFLICT upserts
  • EXPLAIN ANALYZE diagnosis with the exact index or rewrite that fixes it
  • Lock-safe migrations: nullable add, batched backfill, NOT VALID then VALIDATE
  • pg_stat_statements and pg_stat_activity queries for slow and blocking sessions

What your AI will do

See a real example
You ask

This query on a 40M row events table filters by user_id and last 7 days, orders by created_at desc, limit 50, and EXPLAIN shows a Seq Scan. Fix it.

Your AI answers

You get: a CREATE INDEX CONCURRENTLY statement on (user_id, created_at DESC) with equality column first and the range-plus-sort column second → a one-line why explaining the planner can walk the index in sort order and stop after 50 rows with no sort node → the EXPLAIN (ANALYZE, BUFFERS) query to rerun and what to look for (Index Scan, far fewer shared reads) → operational notes: CONCURRENTLY cannot run inside a transaction, build off-peak, run ANALYZE afterwards → the next action: create the index, rerun the plan and paste it if a Seq Scan remains.

// faq

Questions before you buy

What does the AI Skill for PostgreSQL do?+

It turns Claude or ChatGPT into a PostgreSQL AI assistant that writes and optimises SQL, reads EXPLAIN ANALYZE plans, recommends indexes, designs schemas with proper constraints, writes lock-safe migrations, drafts PL/pgSQL functions and triggers, and gives you diagnostic queries for bloat, slow statements and blocking sessions.

Does it operate PostgreSQL for me?+

No. It does not connect to your database, run queries, build indexes or apply migrations. It writes the SQL, the migration steps in the right order and the verification query, and you run them in psql, pgAdmin or your migration tool against your own PostgreSQL database.

Can the PostgreSQL skill write migrations that are safe on a live table?+

Yes. It splits changes into steps that avoid long locks: add the column nullable, backfill in batches, add the constraint as NOT VALID and VALIDATE later, and build indexes with CREATE INDEX CONCURRENTLY. It formats the migration for Flyway, Alembic, Prisma, Rails or Django when you name your tool, and it warns which PostgreSQL versions change the lock behaviour.

Does it cover managed PostgreSQL like RDS, Supabase or Neon?+

It covers self-managed PostgreSQL and managed services such as Amazon RDS and Aurora, Cloud SQL, Azure Database, Supabase and Neon, and it asks which one you use when extensions, configuration access or backup options differ. It never invents parameters or version numbers.

How do I open it?+

Download your .skill file from the order email or your account. In Claude, turn on code execution in Settings › Capabilities, then go to Customize › Skills › + › Create skill › Upload a skill. Start a new chat and ask for the specialist by name.

Using ChatGPT, Gemini or another AI? See How it works