
PostgreSQL Table Design
Data & Analyticsby wshobson
3/3 audits passMIT
Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features
PostgreSQL Table Design, published by wshobson under the MIT licence, is a rulebook for designing or reviewing a Postgres schema. Its core rules: give reference tables a BIGINT GENERATED ALWAYS AS IDENTITY primary key (UUID only when global uniqueness is needed), normalise to 3NF and denormalise only for measured wins, add NOT NULL wherever it is semantically required, index the access paths you actually query including foreign keys, and prefer TIMESTAMPTZ, NUMERIC for money, TEXT and BIGINT. A types-to-avoid table replaces timestamp without time zone, varchar(n), money and serial.
It lists Postgres gotchas that catch people moving from other databases: unquoted identifiers are lowercased, UNIQUE allows multiple NULLs unless NULLS NOT DISTINCT is used, foreign-key columns are not indexed automatically, overflows error rather than truncate, and identity sequences have gaps. It then covers constraints (FK actions, CHECK, EXCLUDE for double-booking), index types (composite, covering, partial, expression, GIN, GiST, BRIN) and declarative partitioning for very large tables, with a reference file for arrays, ranges, JSONB and other types.
This skill is mainly for developers and coding agents such as Claude Code writing migrations; it can be imported into BusinessMCP as a playbook, but it is not a business-reporting skill.
What you can do with it
- Review a migration for missing NOT NULLs and unindexed foreign keys
- Pick column types for money, timestamps and identifiers
- Add an EXCLUDE constraint to stop double bookings
- Decide whether and how to partition a large event table
Run it on your business data
Imported into BusinessMCP, PostgreSQL Table Design becomes a playbook your AI business analyst applies to your web analytics, funnels and connected databases.
Use PostgreSQL Table Design in BusinessMCPInstall it in a coding agent
One command adds PostgreSQL Table Design to your project.
npx skills add https://github.com/wshobson/agents --skill postgresql-table-designHow we vetted it
- Source
- wshobson/agents at 4236bb9
- Licence
- MIT
- Security audits (skills.sh)
- Gen Agent Trust Hub: Pass · Socket: Pass · Snyk: Pass
- Bundled scripts
- None, instructions only
Checked 2026-09-25 against its skills.sh listing. How we vet skills
Related skills
All skillsSupabase Postgres Best Practices
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including…
SQL Optimization Patterns
Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.
Neon Postgres
Guides and best practices for working with Lakebase Postgres on Neon: connections, pooled vs direct, schema migrations, branching, autoscaling, scale-to-zero, instant restore, read replicas, IP allow lists, logical…
Frequently asked questions
What types does the skill tell you to avoid?
timestamp without time zone, char(n) and varchar(n), money, timetz, timestamptz with a precision, and serial, each with a recommended replacement such as timestamptz, text, numeric or identity columns.
Does PostgreSQL index foreign keys automatically?
No, and the skill calls this out: Postgres does not auto-index foreign-key columns, so it tells the agent to add those indexes explicitly.
How do I install PostgreSQL Table Design?
Run `npx skills add wshobson/agents --skill postgresql-table-design`, or import it from the BusinessMCP dashboard as a playbook.
Keep exploring
Run PostgreSQL Table Design against your whole business
Free plan, no credit card.
Use PostgreSQL Table Design in BusinessMCP