Codex skills for PostgreSQL
These skills make Codex read the plan before it touches Postgres: EXPLAIN and pg_stat_statements drive index and query changes, migrations get lock_timeout guards and expand-and-contract steps, and backups count only after a timed restore drill. They also cover JSONB, partitioning, row-level security, pgvector and poolers in front of Neon or Supabase.
Start with these 3
- Postgres Indexing Index from query plans, not hunches Codex designs each Postgres index against a specific slow query and its EXPLAIN plan, chooses between B-tree, partial, INCLUDE, expression, GIN and BRIN with clear rules, and always builds with CREATE INDEX CONCURRENTLY. It finds unindexed foreign keys and unused or duplicate indexes, checks replicas and stats age before proposing a drop, and reports before-and-after plans.
- Postgres Query Tuning Read the plan, fix the estimate, then measure Codex starts from pg_stat_statements to find the query costing the most time, captures a plan with real parameters, and names the exact node that goes wrong: misestimates, nested loops over big inputs, sorts spilling to disk. It fixes statistics before rewriting SQL, proves rewrites return identical rows, and changes settings only in the narrowest scope.
- Postgres Schema Design Make invalid rows impossible to insert Codex designs Postgres tables from their access patterns and pushes business rules into the database: bigint identity or uuid keys, timestamptz, numeric or minor-unit money, scoped unique keys, exclusion constraints for overlaps, and explicit ON DELETE on every foreign key. It also reviews ORM-generated DDL for silent type mistakes and documents which rules stay in application code.
29 more PostgreSQL skills
-
Postgres Row-Level Security
Tenant isolation that holds when a WHERE is forgotten -
Postgres Partitioning
Retention by DROP TABLE, not by DELETE -
Postgres JSONB
Flexible JSON without slow, unindexed queries -
Postgres Backup and Restore
Backups proven by a timed restore drill -
Serverless Postgres
Pooled at runtime, direct for migrations, branched per PR -
Supabase Backend
Migrations, RLS and auth checks that hold up -
Testcontainers
Test against real Postgres, not a lookalike -
Zero-Downtime Migrations
Change big tables without a lock-queue outage -
Prisma ORM
Reviewed migrations, lean queries, Prisma 7 ready -
Data Backfills
Touch 80 million rows without anyone noticing -
Multi-Tenancy
One customer never sees another's data -
Full-Text Search
Relevant results, an index that never drifts -
SQL Window Functions
Rankings and running totals that are actually right -
Database Transactions
Stop lost updates, write skew and deadlocks -
Drizzle ORM
TypeScript schema in, reviewed SQL migrations out -
Kysely Query Builder
SQL you would write by hand, checked by tsc -
Connection Pooling
Fit every pool inside max_connections -
TimescaleDB
Hypertables that stay fast after a billion rows -
Database Observability
Know which query, table or slot is hurting you -
CDC with Debezium
Every insert, update and delete, in order -
pgvector Search
HNSW that uses the index and returns a full page -
Docker Compose for Local Dev
One command up, every service healthy -
AWS RDS and Aurora
Failovers, upgrades and restores you have rehearsed -
Railway and Render Deploys
Your whole PaaS stack declared in the repo -
Event Sourcing and CQRS
Append-only truth, rebuildable read models -
Idempotency Keys
Retries that never double charge -
Django ORM Performance
Measure the queryset, then fix the actual cause -
Database Performance Triage
Is it the query, the pool, the locks or the app? -
Outbox Pattern
Publish if and only if the transaction committed
General skills with PostgreSQL guidance
Not built around PostgreSQL, but they include steps or tools for it. Not part of the install-all command.
-
Regex Crafting
Regexes with test tables and no catastrophic backtracking -
Background Jobs
Jobs that survive retries, crashes and deploys -
Geospatial Analysis
Right CRS, valid geometry, honest spatial joins -
SQL for Analytics
Funnels, cohorts and retention you can defend -
Hybrid Search and Reranking
BM25 plus vectors, fused by rank and proven on qrels -
Vector Databases
Pick the store from numbers, then plan the re-embed -
LangGraph Agents
State graphs that pause, resume and survive crashes -
Kamal Deploys
Zero-downtime container deploys to your own servers -
SST v3 Apps
TypeScript infrastructure with links, not hardcoded ARNs -
Edge Functions
Run at the edge only what belongs there -
Distributed Locks
Leases, fencing tokens, or no lock at all -
n8n Workflows
n8n flows that fail loudly and deploy cleanly
Every PostgreSQL skill in one command
Installs these 32 into ~/.agents/skills/. Add --project after -- to install into the current repository instead.
The installer is a 104-line POSIX shell script. It fetches the skills you name from codexskills.dev and unpacks each into its own folder in your skills directory. No sudo, no telemetry, and every skill page shows the full SKILL.md first. Read install.sh
curl -fsSL codexskills.dev/install.sh | sh -s -- postgres-indexing postgres-query-tuning postgres-schema-design postgres-row-level-security postgres-partitioning postgres-jsonb postgres-backup-restore serverless-postgres supabase-backend testcontainers zero-downtime-migrations prisma-orm data-backfills multi-tenancy full-text-search sql-window-functions database-transactions drizzle-orm kysely-query-builder connection-pooling timescaledb database-observability cdc-debezium pgvector-search docker-compose-dev aws-rds-aurora paas-deploys event-sourcing-cqrs idempotency-keys django-orm-performance database-performance-triage outbox-pattern PostgreSQL FAQ
Is there a Codex skill for zero-downtime Postgres migrations?
Yes. Zero-Downtime Migrations classifies each statement by the lock it takes, sets lock_timeout, adds foreign keys and CHECK constraints as NOT VALID before validating them, and splits risky changes into expand, migrate and contract deploys. It has notes for Rails, Django, Alembic and Prisma or Drizzle migrations, and drops a table only after renaming it and waiting a release, with your approval.
Will Codex add Postgres indexes without locking writes?
Postgres Indexing builds every index with CREATE INDEX CONCURRENTLY and explains how to do that from Rails, Django and Alembic migrations, since it cannot run inside a transaction block. Before proposing a drop it checks stats_reset and every read replica, because an index unused on the primary may serve reporting queries elsewhere.
Do these skills work with Supabase and Neon?
Serverless Postgres sets up two connection strings, a pooled transaction-mode URL for the app and a direct URL for migrations, and turns off prepared statements in drivers such as postgres.js and asyncpg where the pooler cannot handle them. Supabase Backend enables RLS on every exposed table and keeps secret keys out of client code, while Postgres Row-Level Security handles the deeper policy design and its per-row cost.
How do I install all 32 PostgreSQL skills at once?
Pass every name to the installer in one command: curl -fsSL https://codexskills.dev/install.sh | sh -s -- postgres-indexing postgres-query-tuning postgres-schema-design postgres-row-level-security postgres-partitioning postgres-jsonb postgres-backup-restore serverless-postgres supabase-backend testcontainers zero-downtime-migrations prisma-orm data-backfills multi-tenancy full-text-search sql-window-functions database-transactions drizzle-orm kysely-query-builder connection-pooling timescaledb database-observability cdc-debezium pgvector-search docker-compose-dev aws-rds-aurora paas-deploys event-sourcing-cqrs idempotency-keys django-orm-performance database-performance-triage outbox-pattern. Add --project right after -- to put them in the current repository's .agents/skills/ so your team gets them too.
Which PostgreSQL skill should I try first?
Postgres Indexing is the closest fit for most PostgreSQL work. Mention it with $postgres-indexing in a prompt to load it on purpose; after that, Codex picks it up on its own whenever a task matches.