postgres-patterns

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

Updated Mar 4, 2026
One-click install
npx skills add https://github.com/Fabio29T/Everything-Claude --skill postgres-patterns-fabio29t
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-patterns
Source: https://github.com/Fabio29T/Everything-Claude/tree/main/docs/ja-JP/skills/postgres-patterns
Command: npx skills add https://github.com/Fabio29T/Everything-Claude --skill postgres-patterns-fabio29t

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, including query writing, schema design, indexing, and security.

Core Features & Use Cases

  • Query Optimization: Offers patterns for efficient SQL queries, including indexing strategies and pagination.
  • Schema Design: Provides guidance on choosing appropriate data types and designing effective table structures.
  • Indexing: Includes cheat sheets for various index types and their use cases.
  • Security: Demonstrates Row Level Security (RLS) implementation.
  • Use Case: When designing a new table, use this Skill to select the correct data types and create appropriate indexes for common query patterns.

Quick Start

Use the postgres-patterns skill to find the best index type for a WHERE clause filtering on a JSONB column.

Frequently Asked Questions about postgres-patterns

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

FAQPage Schema
What is the best index type for filtering PostgreSQL queries on a JSONB column?

To optimize PostgreSQL queries filtering on a JSONB column, use a GIN index. This Skill provides an index cheat sheet covering GIN, composite, and covering indexes to match specific query patterns and improve retrieval performance.

How do I implement cursor pagination in PostgreSQL?

Implement cursor pagination using keyset pagination techniques instead of OFFSET. This Skill provides common patterns for efficient cursor pagination to scan large datasets without performance degradation or table bloat.

Why are my PostgreSQL queries slow and how can I detect anti-patterns?

Slow PostgreSQL queries often stem from missing foreign key indexes or table bloat. This Skill detects anti-patterns like missing indexes and slow queries, offering optimization patterns and configuration templates for timeouts and monitoring.

How do I configure Row Level Security policies in Supabase?

Configure Row Level Security (RLS) policies using Supabase best practices. This Skill provides RLS implementation patterns alongside database security guidance to restrict data access directly at the schema level.

What are the recommended data types for PostgreSQL schema design?

Recommended PostgreSQL data types depend on specific query patterns and storage needs. This Skill provides schema design guidance to choose appropriate data types, ensuring effective table structures and query optimization.

How do I configure PostgreSQL connection timeouts and monitoring?

Configure PostgreSQL connections, timeouts, and monitoring using provided configuration templates. This Skill includes templates for managing database connections and detecting performance issues like table bloat and slow queries.