PostgreSQL Patterns

•
10
•

Optimizes PostgreSQL schemas, indexing strategies, query performance, and Row Level Security policies based on Supabase best practices.

PostgreSQL Patterns provides an essential reference guide for designing performant, scalable, and secure PostgreSQL databases within Claude Code. Drawing from battle-tested Supabase best practices, this skill equips Claude with actionable patterns for index selection across B-tree, GIN, and BRIN types, schema type choices, efficient cursor pagination, and SKIP LOCKED job queue implementation. It also includes diagnostics for detecting missing foreign key indexes, slow queries via pg_stat_statements, and table bloat, making it invaluable for developers writing migrations, building RLS policies, and tuning SQL workloads.

主要功能

01Recommended schema data type guidelines and configuration templates for memory and timeouts
02Index selection cheat sheet covering B-tree, GIN, BRIN, covering, and partial indexes
03Anti-pattern detection queries for unindexed foreign keys, table bloat, and slow queries
04Production-grade query patterns including cursor pagination, upserts, and job queues with SKIP LOCKED
05Optimized Row Level Security (RLS) policies and PostgreSQL permission hardening templates
0610 GitHub stars

使用场景

01Implementing scalable multi-tenant Row Level Security (RLS) rules in modern PostgreSQL and Supabase apps
02Designing normalized and performant database schemas with proper index strategies during migrations
03Troubleshooting slow queries, table bloat, and missing indexes using pg_stat_statements and catalog queries