postgres-patterns

Provides PostgreSQL/Supabase best-practice cheat sheets for indexes, data types, and security configurations.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/hummbl-dev/hummbl-agent --skill postgres-patterns-hummbl-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-patterns
Source: https://github.com/hummbl-dev/hummbl-agent/tree/main/skills/postgres-patterns
Command: npx skills add https://github.com/hummbl-dev/hummbl-agent --skill postgres-patterns-hummbl-dev

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 users optimize queries, design schemas, implement indexing, and enhance security.

Core Features & Use Cases

  • Query Optimization: Learn efficient SQL patterns for common query types.
  • Schema Design: Understand correct data types and avoid anti-patterns.
  • Indexing Strategies: Quick reference for B-tree, GIN, BRIN, and composite indexes.
  • Security: Implement Row Level Security (RLS) policies effectively.
  • Use Case: When designing a new table, quickly consult the data type reference to ensure you're using timestamptz instead of timestamp for time zone awareness.

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
How do I optimize PostgreSQL queries for better performance?

To optimize PostgreSQL queries, apply efficient SQL patterns and indexing strategies like B-tree, GIN, or BRIN indexes. This reference guide helps identify anti-patterns and implement correct data types to improve database execution speed.

What are the best practices for PostgreSQL schema design?

PostgreSQL schema design best practices involve selecting correct data types, such as using timestamptz instead of timestamp, and avoiding structural anti-patterns. This ensures robust schemas and prevents common data integrity issues.

When should I use GIN versus BRIN indexes in PostgreSQL?

Use GIN indexes for composite data types like JSONB and BRIN indexes for large tables with naturally sorted data. This reference provides a cheat sheet to quickly determine the right indexing strategy for your query patterns.

How do I implement Row Level Security policies in PostgreSQL?

Implement Row Level Security (RLS) in PostgreSQL by configuring policy templates that restrict data access at the row level. This guide provides security configurations based on Supabase best practices to enforce data protection.

Can this reference help detect SQL anti-patterns in my database?

Yes, this PostgreSQL reference includes anti-pattern detection cheat sheets. It helps developers spot inefficient SQL structures and schema design flaws, offering correct alternatives to ensure database optimization.

Does this PostgreSQL optimization guide apply to Supabase projects?

Yes, the PostgreSQL optimization and security best practices are based on Supabase guidelines. They apply directly to Supabase database schemas, offering configuration templates and indexing strategies for that environment.