design-postgres-tables

Generates PostgreSQL table designs with PK/FK constraints and indexing recommendations.

Updated Feb 11, 2026
One-click install
npx skills add https://github.com/knguyen0125/claude-plugin --skill design-postgres-tables-knguyen0125
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: design-postgres-tables
Source: https://github.com/knguyen0125/claude-plugin/tree/main/plugins/engineering/skills/design-postgres-tables
Command: npx skills add https://github.com/knguyen0125/claude-plugin --skill design-postgres-tables-knguyen0125

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Design and architect PostgreSQL schemas and tables to balance normalization, data integrity, and performance, providing a practical framework for PK/FK design, data types, constraints, and indexing strategies.

Core Features & Use Cases

  • Establishes proper PRIMARY KEY strategies (prefer BIGINT GENERATED ALWAYS AS IDENTITY) and FOREIGN KEY relationships with appropriate ON DELETE actions.
  • Guides data-type selection, NOT NULL constraints, defaults, indexing plans (PK/unique, FK columns, and frequently filtered fields), and partitioning for large datasets.
  • Covers PostgreSQL-specific best practices, common gotchas, JSONB usage guidance, and extension considerations to support scalable OLTP workloads.

Quick Start

Provide a PostgreSQL table design plan for a typical e-commerce domain (users, products, orders, order_items) with primary keys, foreign keys, appropriate data types, and indexing recommendations.

Frequently Asked Questions about design-postgres-tables

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design PostgreSQL tables for an e-commerce schema?

Design PostgreSQL schemas by enforcing normalization to 3NF, using BIGINT GENERATED ALWAYS AS IDENTITY for primary keys, and defining explicit NOT NULL constraints with appropriate foreign key ON DELETE actions.

What is the best way to choose PostgreSQL data types and constraints?

Best practices for PostgreSQL table design include enforcing 3NF normalization, using BIGINT GENERATED ALWAYS AS IDENTITY for primary keys, and applying explicit NOT NULL constraints with appropriate foreign key ON DELETE actions.

When do I need partitioning and indexing for PostgreSQL OLTP workloads?

PostgreSQL partitioning and indexing for OLTP workloads are needed when managing large datasets, requiring indexes on PK/unique columns, foreign key columns, and frequently filtered fields to maintain query performance.

Does PostgreSQL schema design support JSONB usage for scalable applications?

PostgreSQL schema design supports JSONB usage for scalable applications by providing specific best practices and extension considerations to balance data integrity and performance in OLTP workloads.

What are the limitations of normalization in PostgreSQL table design?

Normalization limitations in PostgreSQL table design arise when balancing 3NF strictness against OLTP performance, requiring careful indexing, partitioning, and JSONB strategies to mitigate query overhead for large datasets.