novahiz-postgreslisted
Install: claude install-skill novahiz/novahiz
# novahiz-postgres
Postgres practices ordered by impact. Eight rule categories run from critical (query shape, connections) down to advanced features.
## When to apply
Consult this skill when writing SQL, designing schemas, adding indexes, tuning queries, sizing pools, writing RLS policies, or planning migrations.
## Categories by priority
| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Query performance | CRITICAL | `query-` |
| 2 | Connection management | CRITICAL | `conn-` |
| 3 | Security and RLS | CRITICAL | `security-` |
| 4 | Schema design | HIGH | `schema-` |
| 5 | Concurrency and locking | MEDIUM-HIGH | `lock-` |
| 6 | Data access patterns | MEDIUM | `data-` |
| 7 | Monitoring and diagnostics | LOW-MEDIUM | `monitor-` |
| 8 | Advanced features | LOW | `advanced-` |
## Core principles
### Design around real query patterns
Start from how the application reads and writes. Keep hot tables narrow. Pick primary keys on purpose (bigint for internal keys, uuid for public ones). Shape indexes early so the access path stays obvious.
### Use the smallest correct type
`int` is 4 bytes, `bigint` is 8. `text` costs nothing against `varchar` for most strings. Event times use `timestamptz`, never naive `timestamp`. Reach for `jsonb` only when the document shape truly needs to flex.
### Normalize first, denormalize on evidence
Begin in 3NF for clarity and integrity. Flatten a relation only when measured reads justify it, and docum