Back to catalog / Developer tools
PostgreSQL table design: derive constraints and indexes from access patterns
Design PostgreSQL DDL from data semantics, query paths, and migration impact.
Skills
Gather read/write patterns, data scale, uniqueness, and deletion semantics before choosing types and constraints. Use suitable identity/UUID IDs, NUMERIC for exact amounts, and TIMESTAMPTZ for instants. State nullability explicitly and avoid encoding volatile business values as rigid database enums. Design indexes for actual filters and ordering, then verify with EXPLAIN rather than guessing. Assess locking and backfill impact of NOT NULL constraints/indexes on large existing tables. Write staged migration and rollback plans and test on a copy first.
Permissions
Prerequisites
- For PostgreSQL-specific table schemas, types, constraints, indexes, and migrations.
- Needs access patterns, data scale, retention, and compatibility window.
Permissions
- May edit DDL/migrations and run explain or local database tests.
- DDL can lock tables or rewrite data; assess locks/rollback and do not run in production without approval.
Limitations
Specify nullability/uniqueness/FK semantics; use NUMERIC for exact amounts and TIMESTAMPTZ for instants; justify indexes with plans.
Pinned upstream source
- Repository
- wshobson/agents
- File path
- plugins/database-design/skills/postgresql-table-design/SKILL.md
- Pinned commit
46891e7e60da0e52baf1050b7b6391b64e84c6d9- Source checked
- 2026-10-14 · Reviewed against the pinned upstream source
Repository metrics
These values describe the upstream repository, not popularity or likes for an individual skill or playbook.
- Stars
- Not collected
- Forks
- Not collected
- Observed at
- Not collected
No metrics snapshot is available yet.
License: MIT
Compatible tools
PostgreSQL schema · Migration tool · EXPLAIN
Main topic
Take a coding Agent change from context to verification