postgres-patterns

Optimize PostgreSQL queries, schemas, indexing, and security with vetted patterns.

3|Updated Jan 25, 2026
One-click install
npx skills add https://github.com/dongitran/ai-agent-config --skill postgres-patterns-dongitran
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-patterns
Source: https://github.com/dongitran/ai-agent-config/tree/main/.agent/skills/postgres-patterns
Command: npx skills add https://github.com/dongitran/ai-agent-config --skill postgres-patterns-dongitran

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PostgreSQL patterns are often scattered across docs and memory, leading to inconsistent performance and security gaps. This Skill consolidates best practices into a quick-reference guide to standardize how you approach queries, schemas, indexing, and access control.

Core Features & Use Cases

  • Query optimization: Choose appropriate indexes, data types, and upsert strategies to maximize performance.
  • Schema design & security: Apply patterns for robust schemas, Row Level Security, and safe defaults.
  • Use Case: When you need to tune a slow query or design a secure multi-tenant schema, you can consult the patterns and apply a proven approach.

Quick Start

Use this Skill as a reference to implement optimized PostgreSQL patterns in your application workflows.

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 with the right indexing and data types?

PostgreSQL query optimization patterns guide you in choosing appropriate index types, data types, and upsert strategies to maximize performance across development, staging, and production environments.

What is the best way to design a secure multi-tenant PostgreSQL schema with RLS?

Designing a secure multi-tenant PostgreSQL schema involves applying robust schema patterns, Row Level Security policies, and safe defaults to ensure standardized access control across environments.

When should I use different PostgreSQL index types for query optimization?

PostgreSQL index types should be selected based on specific query patterns and data structures; this Skill provides practical guidance on matching appropriate index strategies to tune performance and apply proven SQL techniques.

Does this PostgreSQL patterns reference cover UPSERT patterns and common SQL techniques?

Yes, this PostgreSQL patterns reference covers UPSERT strategies and common SQL techniques, consolidating scattered documentation into a concise guide for query optimization, schema design, indexing, and access control.

Can I apply these PostgreSQL schema and security patterns across staging and production environments?

Yes, these PostgreSQL patterns apply across staging and production environments, covering security considerations and robust schema design with safe defaults to ensure consistent performance and access control from development through production.