postgres-patterns

Provide PostgreSQL query optimization, schema design, indexing, and security patterns.

Updated Feb 13, 2026
One-click install
npx skills add https://github.com/LiamVDB1/opencode-config --skill postgres-patterns-liamvdb1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-patterns
Source: https://github.com/LiamVDB1/opencode-config/tree/main/skills/postgres-patterns
Command: npx skills add https://github.com/LiamVDB1/opencode-config --skill postgres-patterns-liamvdb1

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, and security.

Core Features & Use Cases

  • Query Optimization: Learn efficient indexing strategies and query patterns.
  • Schema Design: Understand correct data types and table structures.
  • Security: Implement Row Level Security (RLS) effectively.
  • Use Case: When encountering slow SQL queries or designing new database schemas, consult this Skill for proven patterns and anti-patterns.

Quick Start

Use the postgres-patterns skill to generate a composite index for a table with columns user_id and created_at.

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, apply efficient indexing strategies and query patterns. This skill identifies anti-patterns like unindexed foreign keys and provides proven SQL patterns to improve database performance.

What are the best practices for PostgreSQL schema design?

PostgreSQL schema design best practices involve selecting correct data types and structuring tables efficiently. This skill provides data type recommendations and references based on Supabase patterns to ensure scalable database structures.

When do I need a composite index in PostgreSQL?

You need a composite index in PostgreSQL when queries filter or sort by multiple columns simultaneously. This skill provides indexing cheat sheets to generate composite indexes for columns like user_id and created_at.

How does Row Level Security work in PostgreSQL?

Row Level Security (RLS) in PostgreSQL restricts data access at the row level based on user policies. This skill covers common SQL patterns to implement RLS effectively for database security.

What are common PostgreSQL anti-patterns to avoid?

Common PostgreSQL anti-patterns include unindexed foreign keys and inefficient query structures that cause slow performance. This skill detects these anti-patterns and recommends optimized SQL patterns and indexing strategies.