What problem does it solve? PostgreSQL performance and correctness problems — slow queries, dangerous migrations on live tables, leaking row-level security policies, and connection pool failures — usually stem from subtle version-specific behaviors that generic advice gets wrong. This Skill provides verified, version-gated rules and diagnostic workflows for PostgreSQL 14 through 18. ## Core Features & Use Cases - Query and index tuning: Read EXPLAIN (ANALYZE, BUFFERS) plans per-loop, fix estimate errors with extended statistics, and choose composite, partial, expression, or covering indexes based on operator and predicate order. - Safe online schema changes: Classify every DDL statement by lock level and rewrite behavior, split migrations into separately committed steps, use NOT VALID constraints and CREATE INDEX CONCURRENTLY, and batch backfills by primary key. - RLS, pooling, and diagnostics: Write row-level security policies with correct USING/WITH CHECK semantics, survive transaction-mode poolers like PgBouncer, and answer "why is it slow" with pg_stat catalogue queries. - Use Case: A migration adds a column with a volatile default and a bare CREATE INDEX on a 180M-row production table. The Skill flags the ACCESS EXCLUSIVE lock queue, the full table rewrite, and the blocked writes, then rewrites the file into safe separately-committed steps. ## Quick Start Review my PostgreSQL migration file and slow query plan, then tell me which statements are dangerous on a live table and which indexes to create or drop.