SKILL461.9K installs2.9K

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-practices

Use cases


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.


Categories


More from supabase


Similar Skills