BusinessMCP
PostgreSQL Table Design logo

PostgreSQL Table Design

Data & Analytics

by wshobson

3/3 audits passMIT

Use PostgreSQL Table Design in BusinessMCP

Free · imported in one click after signup

View on GitHub

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 BusinessMCP

Install 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-design

How 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

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.

Run PostgreSQL Table Design against your whole business

Free plan, no credit card.

Use PostgreSQL Table Design in BusinessMCP