postgres-patterns

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

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/yd5768365-hue/caw-cli --skill postgres-patterns-yd5768365-hue
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-patterns
Source: https://github.com/yd5768365-hue/caw-cli/tree/main/everything-claude-code-main/everything-claude-code-main/docs/ja-JP/skills/postgres-patterns
Command: npx skills add https://github.com/yd5768365-hue/caw-cli --skill postgres-patterns-yd5768365-hue

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a quick reference for optimizing PostgreSQL database performance, schema design, indexing, and security, based on Supabase best practices.

Core Features & Use Cases

  • Index Cheat Sheet: Quickly find the right index type for common query patterns.
  • Data Type Recommendations: Choose the most efficient and appropriate data types for your columns.
  • Common Patterns & Anti-Patterns: Learn best practices for indexing, RLS, UPSERT, pagination, and queueing, and identify common pitfalls.
  • Configuration Templates: Get starting points for essential PostgreSQL settings.
  • Use Case: When designing a new table, consult the data type recommendations to ensure efficient storage and querying. When troubleshooting slow queries, refer to the index cheat sheet and anti-pattern detection examples.

Quick Start

Use the postgres-patterns skill to find the correct index type for a query that filters by a JSONB field.

Frequently Asked Questions about postgres-patterns

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

FAQPage Schema
How do I choose the right PostgreSQL index type for slow queries?

To optimize slow PostgreSQL queries, you select the correct index type based on your query pattern, such as using GIN for JSONB filtering. This reference provides an index cheat sheet derived from Supabase guidelines to match index types to common query patterns.

What are common PostgreSQL anti-patterns for schema design and table bloat?

Common PostgreSQL anti-patterns include inefficient data type choices and poor indexing strategies that lead to table bloat and slow queries. This reference helps detect these pitfalls and provides schema design recommendations to ensure efficient storage and querying.

How do I implement cursor pagination and UPSERT patterns in PostgreSQL?

You implement cursor pagination and UPSERT patterns in PostgreSQL by following established SQL best practices to handle data updates and large dataset traversal efficiently. This guide covers these common SQL patterns alongside queueing and Row Level Security guidelines.

What are the best PostgreSQL data types for efficient storage and querying?

The best PostgreSQL data types for efficient storage and querying are those that precisely match your data's domain and access patterns. This reference provides data type recommendations to help you choose the most appropriate columns when designing new tables.

Are there basic configuration templates for PostgreSQL system settings?

Yes, there are basic configuration templates for essential PostgreSQL system settings to help you establish a performance baseline. This Skill provides starting points for system configuration derived from Supabase best practices.