From 3e287377c81282a0a1741e4bd3350a242c7d70f7 Mon Sep 17 00:00:00 2001 From: 7ttp <117663341+7ttp@users.noreply.github.com> Date: Sun, 22 Feb 2026 21:40:58 +0530 Subject: [PATCH] docs: add privilege migration note for db dump --- docs/supabase/db/dump.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/supabase/db/dump.md b/docs/supabase/db/dump.md index 2ccfef091e..3d5c4fae54 100644 --- a/docs/supabase/db/dump.md +++ b/docs/supabase/db/dump.md @@ -7,3 +7,12 @@ Requires your local project to be linked to a remote database by running `supaba Runs `pg_dump` in a container with additional flags to exclude Supabase managed schemas. The ignored schemas include auth, storage, and those created by extensions. The default dump does not contain any data or custom roles. To dump those contents explicitly, specify either the `--data-only` and `--role-only` flag. + +### Note on Privilege Migration + +When restoring to a new project, tables inherit ALL privileges from default privileges in the target database. To preserve specific privileges from your dump, revoke defaults before restoring: + +```sql +-- Run BEFORE restoring your schema +ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON TABLES FROM anon, authenticated; +```