Skip to content

Commit 2ce63b0

Browse files
committed
fix: add more roles
1 parent 2e54f13 commit 2ce63b0

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

migrations/db/migrations/20250605172253_grant_with_admin_to_postgres_16_and_above.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ BEGIN
66
SELECT current_setting('server_version_num')::INT / 10000 INTO major_version;
77

88
IF major_version >= 16 THEN
9-
GRANT anon, authenticated, service_role TO postgres WITH ADMIN OPTION;
9+
GRANT anon, authenticated, service_role, authenticator, pg_monitor, pg_read_all_data, pg_signal_backend TO postgres WITH ADMIN OPTION;
1010
END IF;
1111
END $$;
1212

nix/tests/sql/z_15_roles.sql

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
-- version-specific role memberships
2+
select
3+
r.rolname as member,
4+
g.rolname as "member_of (can become)",
5+
m.admin_option
6+
from
7+
pg_roles r
8+
left join
9+
pg_auth_members m on r.oid = m.member
10+
left join
11+
pg_roles g on m.roleid = g.oid
12+
order by
13+
r.rolname, g.rolname;

nix/tests/sql/z_17_roles.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ left join
3232
pg_auth_members m on r.oid = m.member
3333
left join
3434
pg_roles g on m.roleid = g.oid
35-
where r.rolname in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections')
36-
or g.rolname in ('pg_create_subscription', 'pg_maintain', 'pg_use_reserved_connections')
3735
order by
3836
r.rolname, g.rolname;
3937

0 commit comments

Comments
 (0)