postgres-patterns

Provides PostgreSQL patterns for query optimization, schema design, indexing, and security.

Updated Jun 2, 2025
One-click install
npx skills add https://github.com/wraithyy/dotfiles --skill postgres-patterns-wraithyy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-patterns
Source: https://github.com/wraithyy/dotfiles/tree/main/dot_claude/skills/postgres-patterns
Command: npx skills add https://github.com/wraithyy/dotfiles --skill postgres-patterns-wraithyy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides best practices and quick references for optimizing PostgreSQL database performance, schema design, indexing strategies, and security configurations.

Core Features & Use Cases

  • Query Optimization: Learn efficient SQL patterns and index usage.
  • Schema Design: Understand correct data types and table structures.
  • Security: Implement Row Level Security (RLS) and connection pooling.
  • Use Case: When encountering slow-running queries or designing a new database schema, consult this Skill for proven patterns and anti-patterns.

Quick Start

Show me the best practices for creating composite indexes in PostgreSQL.

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 with the right index types?

Optimizing slow PostgreSQL queries requires selecting appropriate index types and using composite or covering indexes. This ensures efficient data retrieval and significantly improves database performance.

What is the best way to design a PostgreSQL schema for performance?

The best way to design a PostgreSQL schema for performance is by choosing correct data types and structuring tables properly. Following proven schema design patterns prevents anti-patterns and ensures query efficiency.

How do I implement Row Level Security policies in Supabase?

Implementing Row Level Security policies in Supabase involves configuring specific database rules to restrict data access. This security measure ensures users only view rows they are explicitly authorized to access.

Does PostgreSQL support cursor pagination and UPSERT operations?

Yes, PostgreSQL supports cursor pagination and UPSERT operations. Cursor pagination handles large datasets efficiently without offset overhead, while UPSERT operations safely insert or update records to prevent conflicts.

What are common PostgreSQL anti-patterns for queue processing?

Common PostgreSQL anti-patterns for queue processing include inefficient polling and missing indexes. Detecting these anti-patterns and applying recommended configuration templates prevents database bottlenecks during queue processing.