postgres-patterns

Reference PostgreSQL optimization, schema design, and security best practices.

1|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/TakMczk/copilot-cli-ecc --skill postgres-patterns-takmczk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-patterns
Source: https://github.com/TakMczk/copilot-cli-ecc/tree/main/.github/skills/postgres-patterns
Command: npx skills add https://github.com/TakMczk/copilot-cli-ecc --skill postgres-patterns-takmczk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides quick access to essential PostgreSQL best practices, helping developers write efficient, secure, and well-designed database queries and schemas.

Core Features & Use Cases

  • Index Optimization: Guidance on choosing the right index types (B-tree, GIN, BRIN) for various query patterns.
  • Data Type Selection: Recommendations for appropriate data types to ensure data integrity and performance.
  • Schema Design Patterns: Examples for composite indexes, covering indexes, partial indexes, and efficient UPSERT operations.
  • Security & Performance: Tips on Row Level Security (RLS) policies, anti-pattern detection for slow queries and table bloat, and basic configuration tuning.

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 choose the right PostgreSQL index type for my query patterns?

Choosing the right PostgreSQL index type requires matching index structures to query patterns. This reference provides guidance on selecting B-tree, GIN, and BRIN indexes to optimize specific data access operations and improve performance.

What are common PostgreSQL anti-patterns that cause slow queries and table bloat?

Common PostgreSQL anti-patterns causing slow queries and table bloat include inefficient schema designs and poorly chosen data types. This reference detects these performance issues and recommends best practices to resolve them.

How do I write an efficient UPSERT operation in PostgreSQL?

Writing an efficient UPSERT operation in PostgreSQL relies on proper schema design patterns. This reference provides examples of efficient UPSERT operations alongside composite, covering, and partial index implementations.

Does this PostgreSQL best practices reference include Row Level Security policies?

Yes, this PostgreSQL best practices reference includes Row Level Security (RLS) policies. It provides security tips and configuration tuning templates to ensure efficient and secure database development.

What is the best way to select data types in PostgreSQL for data integrity?

The best way to select data types in PostgreSQL for data integrity is following established best practices. This reference offers recommendations for appropriate data type selection to ensure both data integrity and performance.