A Claude Code skill carrying a field-tested PostgreSQL, migration, and multi-tenant schema playbook. Every entry was learned debugging real systems; dates in the text are provenance stamps for when a claim was verified.
| Section | Covers |
|---|---|
| Concurrency | max_connections as the first scaling wall under parallel test workers, and why a Dockerized Postgres must set it as a compose flag |
| Migrations | CREATE INDEX CONCURRENTLY vs transactions, why deleting a migration file breaks live DBs |
| Query gotchas | COALESCE type coercion, make_interval, the 42P18/42P08 parameter type-deduction family, LEFT JOIN ON-clause filtering, LATERAL dedup-to-one, the FOR UPDATE SKIP LOCKED queue-claim pattern |
| Cloning tables | What LIKE ... INCLUDING ALL silently drops (triggers) and renames (constraints), and why to match SQLSTATE + column signature instead of constraint names |
| Extensions | pgvector naming, pgcrypto, RDS privilege limits |
| Privileges | Why GRANT ALL is almost never right, append-only audit-table grants |
| Row-level security | FORCE ROW LEVEL SECURITY, the superuser false-green trap, the zero-rows read-path variant, USING vs WITH CHECK |
| Schema-per-tenant | The DO $$ loop pattern for migrating every tenant schema, vanishing-schema tolerance, idempotent seed corrections |
As a user-level skill (available in every project):
git clone https://github.com/Corvalon/skill-postgres.git ~/.claude/skills/skill_postgresOr as a project-level skill:
git clone https://github.com/Corvalon/skill-postgres.git <your-repo>/.claude/skills/skill_postgresClaude Code discovers SKILL.md automatically and loads it when a session starts writing SQL
migrations, diagnosing a SQLSTATE, or configuring row-level security.
MIT. See LICENSE.