postgres-patterns

Apply PostgreSQL best-practice patterns to optimize queries, indexes, and security policies.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill postgres-patterns-sakamoto-family-smile
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-patterns
Source: https://github.com/sakamoto-family-smile/agent_monorepo/tree/main/.claude/skills/ecc/postgres-patterns
Command: npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill postgres-patterns-sakamoto-family-smile

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PostgreSQL patterns provide quick-reference guidance for optimizing queries, designing schemas, and implementing security features efficiently.

Core Features & Use Cases

  • Pattern-driven query optimization (indexes, partial indexes, composite indexes)
  • Schema design and data-type guidance for robust PostgreSQL schemas
  • Security patterns including Row-Level Security and policy design for safe access control

Quick Start

Apply a PostgreSQL pattern to optimize a slow query in the current schema.

Frequently Asked Questions about postgres-patterns

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

FAQPage Schema
How do I optimize slow PostgreSQL queries using indexing strategies?

Optimize slow PostgreSQL queries by applying pattern-driven indexing strategies, utilizing partial and composite indexes to target specific query loads and reduce execution time.

What is the best way to design Row-Level Security policies in Supabase?

Design Row-Level Security policies in Supabase by applying established PostgreSQL security patterns to enforce safe access control and restrict data visibility at the row level.

How does schema design impact PostgreSQL performance and data integrity?

Schema design impacts PostgreSQL performance by defining robust data types and structural patterns, which directly influence query efficiency and overall database integrity.

When do I need partial indexes versus composite indexes in PostgreSQL?

Use partial indexes to optimize queries filtering on a specific subset of data, while composite indexes accelerate multi-column queries, both guided by pattern-based selection criteria.

Can I debug slow database tasks by applying these PostgreSQL patterns?

Debug slow database tasks by applying routine PostgreSQL patterns to identify inefficient queries, tune performance, and implement correct indexing and data type requirements.

What are the limitations of using pattern-based query optimization for routine DB tasks?

Pattern-based query optimization for routine DB tasks requires strict adherence to defined requirements for indexing, data types, and policy design to prevent ineffective performance tuning.