postgres-patterns

Optimize PostgreSQL queries, schemas, and security configurations.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you make PostgreSQL databases faster, cleaner, and safer by guiding query tuning, schema choices, indexing, and access control decisions.

Core Features & Use Cases

  • Query Optimization: Choose efficient indexes and query shapes for common filters, joins, pagination, and queue processing.
  • Schema and Data Type Guidance: Pick database types and constraints that improve correctness, performance, and maintainability.
  • Security and Operations: Apply Row Level Security patterns, connection settings, monitoring checks, and anti-pattern detection for production readiness.
  • Use Case: If a reporting query is slow or a migration introduces poor indexing, this Skill helps you identify the cause and apply a safer PostgreSQL pattern.

Quick Start

Use the postgres-patterns skill to review my PostgreSQL schema or query and suggest the best indexing, security, and performance improvements.

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 in a production backend?

PostgreSQL query optimization involves evaluating predicates, data types, and execution plans to choose efficient indexes and query shapes for filters, joins, and pagination. This Skill reviews your SQL to identify causes of slow reporting queries and applies production-safe tuning patterns.

What is the best way to design a PostgreSQL schema for performance and correctness?

Schema design for PostgreSQL requires selecting database types and constraints that improve correctness, performance, and maintainability. This Skill guides you in picking the right data types and constraints during migration design to prevent poor indexing and ensure production readiness.

How do I set up row level security policies in PostgreSQL?

Row level security in PostgreSQL applies access policies to restrict data visibility based on user context. This Skill provides row level security patterns and evaluates access policies to produce deterministic, production-safe security configurations for your database.

When should I add indexes to PostgreSQL tables for queue processing and joins?

Index selection in PostgreSQL should target common filters, joins, pagination, and queue processing workloads. This Skill evaluates your predicates and execution plans to recommend efficient index choices that improve database performance without introducing anti-patterns.

Can I use this PostgreSQL tuning approach for connection pooling and monitoring checks?

Yes, PostgreSQL connection settings and monitoring checks are covered as part of security and operations guidance. This Skill applies connection pooling configurations and anti-pattern detection to ensure production readiness in backend environments.

Why does my PostgreSQL migration introduce poor indexing and how do I fix it?

PostgreSQL migrations can introduce poor indexing when schema changes ignore predicate evaluation and data type selection. This Skill reviews your migration design to detect anti-patterns and suggests safer indexing and schema patterns for production backends.