Skip to content

fix: add privilege migration note for db dump#4885

Open
7ttp wants to merge 2 commits intosupabase:developfrom
7ttp:docs/fix-privilege-migration-4862
Open

fix: add privilege migration note for db dump#4885
7ttp wants to merge 2 commits intosupabase:developfrom
7ttp:docs/fix-privilege-migration-4862

Conversation

@7ttp
Copy link
Contributor

@7ttp 7ttp commented Feb 22, 2026

Problem

When migrating schemas between projects using supabase db dump
table privileges are not preserved. Tables in the target database inherit ALL privileges from default privileges, causing specific GRANT statements to have no effect.

Solution

Document the privilege migration behavior and provide the SQL command to run before restoring.

Related

@7ttp 7ttp requested a review from a team as a code owner February 22, 2026 16:38
@coderabbitai
Copy link

coderabbitai bot commented Feb 22, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Summary by CodeRabbit

  • Documentation
    • Expanded Supabase database restoration documentation with new guidance on privilege migration. The addition explains potential conflicts when default privileges override custom settings during restoration to new projects. Includes detailed pre-restoration procedures and practical SQL examples to help preserve specific database permissions and access controls.

Walkthrough

This pull request adds a "Note on Privilege Migration" section to the Supabase database dump documentation. The new section explains that default privileges assigned to anon and authenticated roles in a new project can override specific privileges from a database dump. It provides a SQL workaround that revokes default privileges before restoring the dump, ensuring that the dumped privileges are correctly applied during migration between Supabase projects.

Assessment against linked issues

Objective Addressed Explanation
Document the privilege migration issue when restoring to a new project [#4862]
Provide a workaround to prevent default privileges from overriding dumped privileges [#4862]

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Privileges are not working correctly during migrating between projects due to default privileges being ALL for anon, authenticated

3 participants