What problem does it solve?
Provides clear, opinionated guidance to design PostgreSQL table schemas that avoid common pitfalls, reduce operational bloat, and deliver predictable query performance across transactional and analytical workloads.
Core Features & Use Cases
- Primary key & identity guidance: recommends BIGINT GENERATED ALWAYS AS IDENTITY for most surrogate keys and UUID use cases when global uniqueness or opacity is required.
- Data type & storage advice: prescribes TIMESTAMPTZ for timestamps, NUMERIC for money, TEXT for strings, JSONB for semi-structured attributes, and vector types for embeddings when applicable.
- Indexing & partitioning patterns: explains B-tree, GIN, GiST, BRIN, composite and partial indexes, covering/index-only scans, and when to use declarative partitioning or TimescaleDB.
- Constraints, RLS & evolution: covers PK/FK/UNIQUE/CHECK/EXCLUDE semantics, row-level security policies, safe transactional DDL, and concurrent index creation strategies.
- Workload-specific recommendations: strategies for update-heavy tables (hot/cold column separation, fillfactor), insert-heavy loads (minimize indexes, COPY), and upsert-friendly designs.
- Extensions and advanced features: notes useful extensions like pgcrypto, pg_trgm, postgis, pgvector, and TimescaleDB for specialized needs.
Quick Start
Ask the skill to review your proposed table schema and return a normalized PostgreSQL DDL with recommended types, indexes, constraints, and partitioning strategy.