postgres-patterns
Installation
SKILL.md
PostgreSQL Patterns
Data Types
| Uso | Tipo |
|---|---|
| IDs | bigint (bigserial) |
| Strings | text |
| Fechas | timestamptz |
| Dinero | numeric(19,4) |
| JSON | jsonb |
| UUID | uuid con gen_random_uuid() |
Indexes
-- B-tree (default)
CREATE INDEX idx_users_email ON users (email);
-- Composite (orden importa)
CREATE INDEX idx_orders ON orders (user_id, created_at DESC);