From 984b691db5800ec8ec99883afd626b592fd8debc Mon Sep 17 00:00:00 2001 From: 7ttp <117663341+7ttp@users.noreply.github.com> Date: Wed, 18 Nov 2026 04:25:02 +0530 Subject: [PATCH 1/2] docs: cover functions and sequences in db dump privilege note --- apps/cli/docs/supabase/db/dump.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/cli/docs/supabase/db/dump.md b/apps/cli/docs/supabase/db/dump.md index d3b7e5de3a..1e966fc9c3 100644 --- a/apps/cli/docs/supabase/db/dump.md +++ b/apps/cli/docs/supabase/db/dump.md @@ -12,9 +12,11 @@ The default dump does not contain any data or custom roles. To dump those conten ### 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: +When restoring to a new project, tables, functions and sequences get the default privileges of the target database, which can grant more than your dump. To preserve specific privileges from your dump, revoke defaults before restoring: ```sql --- Run BEFORE restoring your schema +-- Run BEFORE restoring your schema, and again before any later restore into the same database ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON TABLES FROM anon, authenticated; +ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON FUNCTIONS FROM anon, authenticated; +ALTER DEFAULT PRIVILEGES IN SCHEMA public REVOKE ALL ON SEQUENCES FROM anon, authenticated; ``` From 19d971fc1b1c85a35f0a80bec65da59ddea3999e Mon Sep 17 00:00:00 2001 From: 7ttp <117663341+7ttp@users.noreply.github.com> Date: Wed, 18 Nov 2026 04:54:41 +0530 Subject: [PATCH 2/2] nit --- apps/cli/docs/supabase/db/dump.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/cli/docs/supabase/db/dump.md b/apps/cli/docs/supabase/db/dump.md index 1e966fc9c3..6b75957165 100644 --- a/apps/cli/docs/supabase/db/dump.md +++ b/apps/cli/docs/supabase/db/dump.md @@ -12,7 +12,7 @@ The default dump does not contain any data or custom roles. To dump those conten ### Note on Privilege Migration -When restoring to a new project, tables, functions and sequences get the default privileges of the target database, which can grant more than your dump. To preserve specific privileges from your dump, revoke defaults before restoring: +When restoring to a new project, tables, functions, and sequences get the default privileges of the target database, which can grant more than your dump. To preserve specific privileges from your dump, revoke defaults before restoring: ```sql -- Run BEFORE restoring your schema, and again before any later restore into the same database