Skip to content

Commit

Permalink
feat: dblink extension custom script
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo committed Apr 4, 2024
1 parent 3688dd5 commit 8d73a7d
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
do $$
declare
r record;
begin
for r in (select oid, (aclexplode(proacl)).grantee from pg_proc where proname = 'dblink_connect_u') loop
continue when r.grantee = 'supabase_admin'::regrole;
execute(
format(
'revoke all on function %s(%s) from %s;', r.oid::regproc, pg_get_function_identity_arguments(r.oid), r.grantee::regrole
)
);
end loop;
end
$$;

0 comments on commit 8d73a7d

Please sign in to comment.