postgres-patterns

Provide PostgreSQL patterns for query optimization, schema design, and security.

Updated Jul 8, 2026
One-click install
npx skills add https://github.com/nazrulsoftwaredev/NIT_CRM_2 --skill postgres-patterns-nazrulsoftwaredev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-patterns
Source: https://github.com/nazrulsoftwaredev/NIT_CRM_2/tree/main/.agents/skills/postgres-patterns
Command: npx skills add https://github.com/nazrulsoftwaredev/NIT_CRM_2 --skill postgres-patterns-nazrulsoftwaredev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the complexity of database management by providing standardized, high-performance patterns for schema design, indexing, and security, preventing common performance bottlenecks and vulnerabilities.

Core Features & Use Cases

  • Query Optimization: Provides proven indexing strategies including B-tree, GIN, and BRIN to accelerate slow queries.
  • Schema Best Practices: Offers guidance on data type selection and RLS policy implementation to ensure data integrity and security.
  • Maintenance & Monitoring: Includes templates for identifying table bloat, unindexed foreign keys, and slow-running queries.

Quick Start

Ask the postgres-patterns skill to provide the recommended indexing strategy for a table with high-frequency JSONB search queries.

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 high-frequency JSONB searches?

To optimize slow PostgreSQL queries with high-frequency JSONB searches, apply GIN indexing strategies to accelerate data retrieval. This approach targets slow query performance by ensuring the database engine efficiently locates nested JSON values without full table scans.

What is the best way to implement row-level security in PostgreSQL?

The best way to implement row-level security in PostgreSQL involves applying standardized RLS policy configuration patterns. This ensures data integrity and restricts data access at the row level based on user context, preventing unauthorized data exposure in production environments.

How do I identify table bloat and unindexed foreign keys in a PostgreSQL database?

To identify table bloat and unindexed foreign keys in a PostgreSQL database, use maintenance monitoring templates. These templates detect performance bottlenecks and missing indexes, allowing you to proactively resolve schema design issues before they impact production performance.

When should I use BRIN indexes instead of B-tree indexes for PostgreSQL optimization?

Use BRIN indexes for PostgreSQL optimization when dealing with large tables with naturally ordered data, while B-tree indexes suit standard column lookups. Selecting the correct index type accelerates slow queries and prevents common performance bottlenecks.

Does this PostgreSQL optimization approach work for production environments?

Yes, this PostgreSQL optimization approach works for production environments by providing standardized performance tuning and security implementation patterns. It facilitates connection pooling, data type selection, and anti-pattern detection to ensure database reliability at scale.