What problem does it solve? Designing a PostgreSQL schema without deep knowledge of its type system, indexing behavior, and MVCC internals leads to slow queries, bloated tables, and subtle correctness bugs. This Skill provides concrete rules and patterns for creating well-structured, performant PostgreSQL tables. ## Core Features & Use Cases - Data Type Selection: Enforces correct choices such as TIMESTAMPTZ over TIMESTAMP, TEXT over VARCHAR(n), NUMERIC for money, and BIGINT GENERATED ALWAYS AS IDENTITY over serial. - Indexing & Constraints Guidance: Covers B-tree, GIN, GiST, BRIN, partial, covering, and expression indexes, plus PK/FK/UNIQUE/CHECK/EXCLUDE constraint patterns including the need to manually index foreign keys. - Advanced Patterns: Addresses partitioning strategies, JSONB indexing, row-level security, generated columns, upsert design, safe schema evolution, and workload-specific tuning for insert-heavy or update-heavy tables. - Use Case: When creating a new orders table, apply the Skill to choose identity columns, add a status CHECK constraint, index the foreign key on user_id, and avoid common gotchas like unindexed FKs or volatile defaults that rewrite the table. ## Quick Start Review my PostgreSQL schema for the users and orders tables and suggest improvements following best practices.