Skip to content

Instantly share code, notes, and snippets.

@Schniz
Created July 5, 2022 19:11
Show Gist options
  • Save Schniz/58e75fec55bc42315816dced1e5f5533 to your computer and use it in GitHub Desktop.
Save Schniz/58e75fec55bc42315816dced1e5f5533 to your computer and use it in GitHub Desktop.
Adding a new schema that's queryable in Supabase
create schema if not exists my_new_schema;
alter default privileges for user supabase_admin in schema my_new_schema grant all
on sequences to postgres, anon, authenticated, service_role;
alter default privileges for user supabase_admin in schema my_new_schema grant all
on tables to postgres, anon, authenticated, service_role;
alter default privileges for user supabase_admin in schema my_new_schema grant all
on functions to postgres, anon, authenticated, service_role;
alter default privileges for user postgres in schema my_new_schema grant all
on sequences to postgres, anon, authenticated, service_role;
alter default privileges for user postgres in schema my_new_schema grant all
on tables to postgres, anon, authenticated, service_role;
alter default privileges for user postgres in schema my_new_schema grant all
on functions to postgres, anon, authenticated, service_role;
grant all privileges on schema my_new_schema to postgres;
GRANT USAGE ON SCHEMA my_new_schema TO postgres, anon, authenticated, service_role;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment