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.
- Type
- Skill
- Author
- supabase
- Category
- Database
- GitHub stars
- 2.9K
- Installs
- 461.9K
- Last updated
- October 2, 2026
Install
npx skills add https://github.com/supabase/agent-skills --skill supabase-postgres-best-practicesUse cases
- Design a new Postgres schema with column types, indexes, and RLS policies that hold up.
- Diagnose slow queries, connection exhaustion, locking, or bloat before they reach production.
- Write migrations and declarative schema files, plus the tests that verify RLS policies.
Frequently Asked Questions
When should this skill be loaded?
Before writing or changing anything in a Postgres database, including a one-column change or a single query.
Does it cover jobs and vector search?
Yes, it covers pg_cron and pgmq queues and scheduled jobs, plus pgvector semantic search.
Can it help with rows visible to the wrong tenant?
Yes, it covers RLS policies and diagnosing rows visible to the wrong user or tenant.
About this skill
A set of Postgres best practices from Supabase, meant to be loaded before writing or changing anything in a Postgres database: table and column design, schema and migrations, RLS policies and their tests, indexes, triggers, functions, pg_cron and pgmq jobs, pgvector search, and dump restore or data import. Also relevant when diagnosing slow queries, timeouts, connection exhaustion, locking, bloat, or rows visible to the wrong tenant. Even a one-column change or a single query should go through these rules, since schema, migration, security, and SQL authoring are all covered.
Summary written with AI assistance from the project's public description.
More from supabase
Supabase
Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues);...
by supabase
Supabase Server
Use when planning or writing server-side code that uses `@supabase/server` — Edge Functions, Hono apps, webhook handlers, or any backend that creat...
by supabase
Agent Skills
Official Supabase agent skills for Claude Code
by supabase
Supabase
MCP server for interacting with the Supabase platform
by supabase
Similar Skills
Find Skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", o...
by vercel-labs
Grill Me
A relentless interview to sharpen a plan or design.
by mattpocock
Ai Video Generation
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0,...
by inference-sh
Ai Image Generation
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FL...
by inference-sh