Skip to content
Back to skills

Postgres Best Practices

ASecurity

Supabase Postgres performance best practices. Use when writing, reviewing or optimizing Postgres queries, schema designs or database configurations.

  • 6 stars
  • 0 votes
  • 1 copy
  • 3 views
  • Added September 19, 2026
ai-agentsgosqltestingdatabasesecurityperformance

Security analysis

A100/100

Pro scans all 19 files and shows the line behind each finding

Scanned November 9, 2026

npx -y skills add hybridlabor-api/aos --skill postgres-best-practices --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Postgres Best Practices?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Postgres Best Practices
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hybridlabor-api-postgres-best-practices/badge)](https://www.skillsdirectory.com/skills/hybridlabor-api-postgres-best-practices)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: postgres-best-practices
description: "Supabase Postgres performance best practices. Use when writing, reviewing or optimizing Postgres queries, schema designs or database configurations."
category: library
risk: safe
source: Supabase
date_added: "2026-02-27"
---

# Supabase Postgres Best Practices

Comprehensive performance optimization guide for Postgres, maintained by Supabase. Contains rules across 8 categories, prioritized by impact to guide automated query optimization and schema design.

## When to Use
Reference these guidelines when:
- Writing SQL queries or designing schemas
- Implementing indexes or query optimization
- Reviewing database performance issues
- Configuring connection pooling or scaling
- Optimizing for Postgres-specific features
- Working with Row-Level Security (RLS)

## Rule Categories by Priority

| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Query Performance | CRITICAL | `query-` |
| 2 | Connection Management | CRITICAL | `conn-` |
| 3 | Security & RLS | CRITICAL | `security-` |
| 4 | Schema Design | HIGH | `schema-` |
| 5 | Concurrency & Locking | MEDIUM-HIGH | `lock-` |
| 6 | Data Access Patterns | MEDIUM | `data-` |
| 7 | Monitoring & Diagnostics | LOW-MEDIUM | `monitor-` |
| 8 | Advanced Features | LOW | `advanced-` |

## How to Use

Read individual rule files for detailed explanations and SQL examples:

```
rules/query-missing-indexes.md
rules/schema-partial-indexes.md
rules/_sections.md
```

Each rule file contains:
- Brief explanation of why it matters
- Incorrect SQL example with explanation
- Correct SQL example with explanation
- Optional EXPLAIN output or metrics
- Additional context and references
- Supabase-specific notes (when applicable)

## Full Compiled Document

For the complete guide with all rules expanded: `AGENTS.md`

### When to Use
This skill is applicable to execute the workflow or actions described in the overview.

## Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Files in this skill

  • AGENTS.md43.9 KB
  • README.md3.1 KB
  • SKILL.md2.3 KB
  • rules/_contributing.md4 KB
  • rules/_sections.md1.6 KB
  • rules/_template.md1 KB
  • rules/advanced-full-text-search.md1.4 KB
  • rules/advanced-jsonb-indexing.md1.4 KB
  • rules/conn-idle-timeout.md1.3 KB
  • rules/conn-limits.md1.3 KB
  • rules/conn-pooling.md1.3 KB
  • rules/conn-prepared-statements.md1.5 KB
  • rules/data-batch-inserts.md1.3 KB
  • rules/data-n-plus-one.md1.3 KB
  • rules/data-pagination.md1.3 KB
  • rules/data-upsert.md1.4 KB
  • rules/lock-advisory.md1.5 KB
  • rules/lock-deadlock-prevention.md1.8 KB
  • rules/lock-short-transactions.md1.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.