postgres-patterns

Installation
Summary

PostgreSQL best practices for indexing, schema design, query optimization, and security.

  • Covers six index types with specific use cases: B-tree for equality/range queries, composite for multi-column filters, GIN for JSONB and full-text search, and BRIN for time-series data
  • Includes data type guidance (bigint for IDs, text over varchar, timestamptz for timestamps, numeric for money) and anti-pattern detection queries for unindexed foreign keys and slow queries
  • Provides ready-to-use SQL patterns for covering indexes, partial indexes, cursor pagination, UPSERT, queue processing, and Row Level Security policies
  • Configuration template covers connection limits, timeouts, monitoring setup, and security defaults
SKILL.md

PostgreSQL Patterns

Quick reference for PostgreSQL best practices. For detailed guidance, use the database-reviewer agent.

When to Activate

  • Writing SQL queries or migrations
  • Designing database schemas
  • Troubleshooting slow queries
  • Implementing Row Level Security
  • Setting up connection pooling

Quick Reference

Index Cheat Sheet

Query Pattern Index Type Example
WHERE col = value B-tree (default) CREATE INDEX idx ON t (col)
Related skills
Installs
5.1K
GitHub Stars
179.7K
First Seen
Jan 26, 2026