Skip to content

Commit 761e486

Browse files
committed
fix: pg_cron perms
1 parent 04e8008 commit 761e486

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
grant usage on schema cron to postgres with grant option;
2+
grant all on all functions in schema cron to postgres with grant option;
3+
4+
alter default privileges for user supabase_admin in schema cron grant all
5+
on sequences to postgres with grant option;
6+
alter default privileges for user supabase_admin in schema cron grant all
7+
on tables to postgres with grant option;
8+
alter default privileges for user supabase_admin in schema cron grant all
9+
on functions to postgres with grant option;
10+
11+
grant all privileges on all tables in schema cron to postgres with grant option;
12+
revoke all on table cron.job from postgres;
13+
grant select on table cron.job to postgres with grant option;

common.vars.pkr.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
postgres-version = "15.1.0.129"
1+
postgres-version = "15.1.0.130-cron"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- migrate:up
2+
do $$
3+
begin
4+
if exists (select from pg_extension where extname = 'pg_cron') then
5+
revoke all on table cron.job from postgres;
6+
grant select on table cron.job to postgres with grant option;
7+
end if;
8+
end $$;
9+
10+
drop event trigger if exists issue_pg_cron_access;
11+
drop function if exists extensions.grant_pg_cron_access();
12+
13+
-- migrate:down

0 commit comments

Comments
 (0)