postgresql-table-design

Design PostgreSQL schemas with data types, indexing, constraints, and partitioning.

23|2|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/herdiansah/Antigravity-Skills-Master --skill postgresql-table-design-herdiansah
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql-table-design
Source: https://github.com/herdiansah/Antigravity-Skills-Master/tree/main/.agent/skills/postgresql-table-design
Command: npx skills add https://github.com/herdiansah/Antigravity-Skills-Master --skill postgresql-table-design-herdiansah

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides expert guidance on designing efficient, scalable, and maintainable PostgreSQL database schemas, helping you avoid common pitfalls and leverage advanced features.

Core Features & Use Cases

  • Best Practices: Adheres to normalization, indexing, and data type selection principles.
  • PostgreSQL Specifics: Covers unique features, "gotchas," and optimal configurations for PostgreSQL.
  • Advanced Design: Guides on partitioning, row-level security, JSONB usage, and extensions.
  • Use Case: You need to design a new orders table in PostgreSQL. This Skill will advise on the best data types for order_id, user_id, status, total, and created_at, including appropriate constraints and indexes.

Quick Start

Design a PostgreSQL table for user accounts with email, name, and creation timestamp, ensuring email is unique and case-insensitive.

Frequently Asked Questions about postgresql-table-design

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

FAQPage Schema
How do I design a PostgreSQL schema for insert-heavy workloads?

To design PostgreSQL schemas for insert-heavy workloads, optimize data types, minimize indexes, and use upsert-friendly structures. This guidance provides specific examples to structure tables that handle rapid data ingestion without performance degradation.

What are the best practices for choosing PostgreSQL data types and constraints?

Best practices for PostgreSQL data types and constraints involve selecting optimal formats for specific columns like order_id and created_at. This ensures schema normalization, data integrity, and efficient query performance across different workload profiles.

When should I use PostgreSQL partitioning and JSONB in database design?

PostgreSQL partitioning and JSONB should be used when designing schemas that require managing large datasets or flexible document structures. This approach leverages advanced features to maintain scalability and accommodate semi-structured data efficiently.

Does this PostgreSQL schema design guidance cover common gotchas and row-level security?

Yes, this PostgreSQL schema design guidance addresses common gotchas and covers advanced features including row-level security. It helps you avoid pitfalls and leverage optimal configurations for secure, maintainable database structures.

What is the best way to create a unique case-insensitive index in PostgreSQL?

The best way to create a unique case-insensitive index in PostgreSQL is by applying appropriate constraints and lower-case functions during schema design. This Skill advises on exact column definitions, such as enforcing unique email addresses regardless of case.