postgres-patterns

Identify PostgreSQL best practices for query optimization, schema design, indexing, and security.

Updated May 27, 2025
One-click install
npx skills add https://github.com/vinwang/tools --skill postgres-patterns-vinwang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-patterns
Source: https://github.com/vinwang/tools/tree/main/iflow/skills/postgres-patterns
Command: npx skills add https://github.com/vinwang/tools --skill postgres-patterns-vinwang

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PostgreSQL database patterns for query optimization, schema design, indexing, and security. Based on Supabase best practices.

Core Features & Use Cases

  • Pattern-based guidance for query optimization, indexing strategies, and schema design.
  • Security-focused recommendations including Row Level Security, access control, and safe defaults.
  • Practical examples with SQL templates for common tasks like indexing, upserts, and policy definitions.

Quick Start

Use this reference to quickly locate PostgreSQL patterns and apply them to your current database design task.

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?

PostgreSQL indexing strategies recommend using B-tree indexes for equality queries and composite indexes for multi-column filtering. This provides concrete data-type recommendations and SQL templates to implement efficient database schemas.

How do I implement Row-Level Security in PostgreSQL?

Row-Level Security in PostgreSQL is implemented by defining policy templates that restrict data access based on user roles. This provides security-focused recommendations and example SQL snippets to enforce access control directly at the database layer.

What are the best practices for PostgreSQL schema design?

PostgreSQL schema design best practices involve selecting appropriate data types and structuring tables to support efficient querying. This provides pattern-based guidance for schema design and data-type recommendations to build secure, fast databases.

How do I configure connection pooling for PostgreSQL?

PostgreSQL connection pooling strategies manage concurrent database connections to prevent resource exhaustion. This provides pattern-based guidance to configure pooling and ensure stable, efficient database access under load.

Does this PostgreSQL patterns guidance work for Supabase projects?

Yes, these PostgreSQL patterns are based on Supabase best practices. They provide actionable schema design, query optimization, and security patterns directly applicable to Supabase database implementations.