© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4mo ago•
2 replies
Alfio Basile

Why does db diff --linked show REVOKE statements after db reset, and why did applying them break my

I'm using Supabase CLI for local development. I encountered a confusing situation with database migrations and permissions that broke my app.

After running
supabase db reset
supabase db reset
on both local and remote databases,
supabase db diff --linked
supabase db diff --linked
still showed differences, specifically, hundreds of REVOKE statements for all tables across anon, authenticated, and service_role roles and FUNCTION definitions. I can say that the functions existed both, locally and remotely.

In order to fix my app I did:

grant usage on schema public to anon, authenticated, service_role;
grant all on all tables in schema public to anon, authenticated, service_role;
grant all on all routines in schema public to anon, authenticated, service_role;
grant all on all sequences in schema public to anon, authenticated, service_role;
alter default privileges for role postgres in schema public grant all on tables to anon, authenticated, service_role;
alter default privileges for role postgres in schema public grant all on routines to anon, authenticated, service_role;
alter default privileges for role postgres in schema public grant all on sequences to anon, authenticated, service_role;
grant usage on schema public to anon, authenticated, service_role;
grant all on all tables in schema public to anon, authenticated, service_role;
grant all on all routines in schema public to anon, authenticated, service_role;
grant all on all sequences in schema public to anon, authenticated, service_role;
alter default privileges for role postgres in schema public grant all on tables to anon, authenticated, service_role;
alter default privileges for role postgres in schema public grant all on routines to anon, authenticated, service_role;
alter default privileges for role postgres in schema public grant all on sequences to anon, authenticated, service_role;


So... I am extremelly confused right now.

Why did
supabase db diff --linked
supabase db diff --linked
generate all these REVOKE statements after resetting both databases from the same migration files?
Is there a difference in how Supabase's local environment handles permissions vs remote? Does local apply some default security hardening that remote doesn't?
How do you guys deal with remote vs local Supabase development?

Thanks in advance.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

supabase db diff --linked not working
SupabaseSSupabase / help-and-questions
5mo ago
What is the direction of db diff --linked
SupabaseSSupabase / help-and-questions
4mo ago
Docker Container error when db diff from linked
SupabaseSSupabase / help-and-questions
8mo ago
supabase db pull automatically adds revoke statements in migration scripts
SupabaseSSupabase / help-and-questions
4mo ago