postgres-patterns

Provide PostgreSQL best practices for optimization, schema design, indexing, and security.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/digitalhand/claude-skills-agents --skill postgres-patterns-digitalhand
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-patterns
Source: https://github.com/digitalhand/claude-skills-agents/tree/main/skills/postgres-patterns
Command: npx skills add https://github.com/digitalhand/claude-skills-agents --skill postgres-patterns-digitalhand

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides quick access to best practices for PostgreSQL, helping developers optimize queries, design efficient schemas, implement effective indexing, and secure their databases.

Core Features & Use Cases

  • Query Optimization: Learn optimal indexing strategies and query patterns.
  • Schema Design: Understand correct data types and common design anti-patterns.
  • Security: Implement Row Level Security (RLS) and secure configurations.
  • Use Case: When encountering slow SQL queries, developers can consult this Skill for index recommendations or to identify common anti-patterns like unindexed foreign keys.

Quick Start

Use the postgres-patterns skill to find an example of a composite index.

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?

To optimize slow PostgreSQL queries, implement effective indexing strategies and identify common anti-patterns like unindexed foreign keys. This Skill provides query optimization patterns and index recommendations to resolve performance bottlenecks.

What are common PostgreSQL schema design anti-patterns?

Common PostgreSQL schema design anti-patterns include incorrect data type selection and structural flaws causing table bloat. This Skill helps identify these issues to ensure efficient schema design and avoid performance degradation.

How do I implement Row Level Security in PostgreSQL?

Implementing Row Level Security (RLS) in PostgreSQL involves applying specific policy patterns to restrict data access. This Skill provides best practices and configuration templates for securing your database with RLS policies.

When should I use a composite index in PostgreSQL?

Use a composite index in PostgreSQL when queries filter or sort on multiple columns simultaneously. This Skill offers indexing strategy examples, including composite index creation, to optimize complex query patterns.

How do I configure PostgreSQL connection limits and timeouts?

Configure PostgreSQL connection limits and timeouts using provided configuration templates to manage resource allocation. This Skill includes best practices for setting these parameters to prevent database overload.

What is the best way to perform UPSERT operations in PostgreSQL?

The best way to perform UPSERT operations in PostgreSQL is using standard query patterns for inserting or updating records on conflict. This Skill covers these operations alongside cursor pagination and queue processing patterns.