What problem does it solve? Writing, reviewing, or optimizing Postgres queries and schemas without expert guidance often leads to slow queries, missing indexes, connection exhaustion, and insecure Row-Level Security policies. This Skill supplies a prioritized rule set of Postgres best practices so AI agents and developers produce performant, secure SQL from the start. ## Core Features & Use Cases - Prioritized Rule Library: 8 categories of rules ranked by impact, from critical query performance and connection management to advanced features like full-text search and JSONB indexing. - Error-First SQL Examples: Each rule shows an incorrect pattern with explanation followed by the correct SQL, including EXPLAIN output and quantified performance gains. - Security & RLS Guidance: Covers Row-Level Security policies, least-privilege grants, SECURITY DEFINER risks, and multi-tenant isolation patterns. - Use Case: When designing a new multi-tenant table, consult the schema and security rules to choose proper data types, index foreign keys, and write an RLS policy that enforces tenant isolation without hurting query performance. ## Quick Start Ask the agent to review your SQL query or schema design using the Postgres best practices rules and suggest optimized alternatives.