Agent Wealth HubFree public resources
中文 EN العربية

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

Permissions

Limitations

Specify nullability/uniqueness/FK semantics; use NUMERIC for exact amounts and TIMESTAMPTZ for instants; justify indexes with plans.

Pinned upstream source

https://github.com/wshobson/agents/blob/46891e7e60da0e52baf1050b7b6391b64e84c6d9/plugins/database-design/skills/postgresql-table-design/SKILL.md

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

View skill directory

Main topic

Take a coding Agent change from context to verification

Related resources