postgres-patterns

Reference PostgreSQL patterns for query optimization, schema design, indexing, and security.

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/novvoo/skill-router --skill postgres-patterns-novvoo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-patterns
Source: https://github.com/novvoo/skill-router/tree/main/agent/skills/postgres-patterns
Command: npx skills add https://github.com/novvoo/skill-router --skill postgres-patterns-novvoo

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 schemas, implement indexing, and secure their databases.

Core Features & Use Cases

  • Query Optimization: Learn how to write efficient SQL queries.
  • Schema Design: Understand correct data types and naming conventions.
  • Indexing Strategies: Implement appropriate indexes (B-tree, GIN, BRIN) for various query patterns.
  • Security: Apply Row Level Security (RLS) policies effectively.
  • Use Case: When designing a new table, quickly reference the correct data types for IDs, timestamps, and monetary values to ensure data integrity and performance.

Quick Start

Show me the index cheat sheet for PostgreSQL.

Frequently Asked Questions about postgres-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are the best PostgreSQL indexing strategies for query optimization?

PostgreSQL indexing strategies involve selecting B-tree, GIN, or BRIN indexes based on specific query patterns to optimize database performance. A cheat sheet reference helps developers identify the appropriate index type for their data access requirements.

How do I implement cursor pagination and UPSERT patterns in SQL?

Implementing cursor pagination and UPSERT patterns in SQL requires specific query structures to handle data insertion and retrieval. Reference templates provide common pattern examples to ensure correct query syntax and database optimization.

What is the correct schema design for PostgreSQL data types and naming conventions?

Correct PostgreSQL schema design requires using appropriate data types for IDs, timestamps, and monetary values alongside consistent naming conventions. Following database best practices ensures data integrity and query performance across table structures.

How do I apply Row Level Security policies in PostgreSQL?

Applying Row Level Security (RLS) policies in PostgreSQL involves defining access control rules directly on database tables to restrict data visibility. Effective security implementation requires following established patterns to enforce user-level data isolation.

How do I detect anti-patterns in PostgreSQL query optimization?

Detecting anti-patterns in PostgreSQL query optimization involves identifying inefficient SQL structures and schema designs that degrade database performance. Reference materials provide detection guidelines to spot and correct common architectural mistakes.

Does this PostgreSQL best practices reference include configuration templates?

This PostgreSQL best practices reference includes configuration templates alongside cheat sheets for indexes and data types. Developers gain access to ready-to-use templates for database optimization, schema design, and security implementations.