---
title: "Supabase Postgres Best Practices"
type: skill
id: "supabase-skills/supabase/supabase-postgres-best-practices"
category: "Engineering"
publisher: "Supabase"
license: "MIT"
source: "https://github.com/supabase/agent-skills/tree/c9be0e9"
canonical: "https://labs.pho.chat/en/skills/supabase-skills/supabase/supabase-postgres-best-practices"
open_in_pho: "https://pho.chat/customize?item=supabase-skills%2Fsupabase%2Fsupabase-postgres-best-practices&utm_source=labs&utm_medium=skill-page&utm_campaign=skills-library"
---

# Supabase Postgres Best Practices

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pg_cron, pgmq), vector/semantic search (pgvector), and restoring dumps (pg_restore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

Source: Supabase (MIT), copied at a pinned commit. Free to use. Part of the Phở Skills library (https://labs.pho.chat/en/skills).
Skill set: Supabase and Postgres (https://labs.pho.chat/en/skills/supabase-skills/supabase.md).

## What it covers
- When to Apply
- Rule Categories by Priority
- How to Use
- References

## Other skills in this set
- [Supabase](https://labs.pho.chat/en/skills/supabase-skills/supabase/supabase.md): Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); client libraries and SSR integrations…

## Use it
- In Phở: open https://pho.chat/customize?item=supabase-skills%2Fsupabase%2Fsupabase-postgres-best-practices&utm_source=labs&utm_medium=skill-page&utm_campaign=skills-library and press Try, or add it so Phở loads it whenever a request matches. Phở works with your own API key (OpenAI, Anthropic, Google and others).
- Full instructions (original SKILL.md, unchanged): https://labs.pho.chat/skills/raw/supabase-skills/supabase/skills/supabase-postgres-best-practices/SKILL.md
- Original files: https://github.com/supabase/agent-skills/tree/c9be0e9 (MIT).
- Full machine-readable index: https://labs.pho.chat/skills.json
