1- -- supabase_monitor_admin: passwordless, read-only
2- -- monitoring role (
3- -- migrations/db/init-scripts/00000000000000-initial-schema.sql).
4- -- attributes: login, no password, bypassrls, nothing else
1+ -- supabase_monitor_admin: passwordless, read-only monitoring role
2+ -- (migrations/db/migrations/20261113000000_supabase_monitor_admin.sql)
3+ -- attributes: login, no password, bypassrls, no connection limit, nothing else
54select rolsuper, rolinherit, rolcreaterole, rolcreatedb, rolcanlogin,
65 rolreplication, rolbypassrls, rolconnlimit, rolpassword is null as no_password
76from pg_authid where rolname = 'supabase_monitor_admin';
87 rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | no_password
98----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------
10- f | t | f | f | t | f | t | 2 | t
9+ f | t | f | f | t | f | t | -1 | t
1110(1 row)
1211
13- -- per-role settings (read-only by default, empty search_path, timeouts)
12+ -- per-role settings (read-only by default, search_path pg_catalog + pg_temp , timeouts)
1413select unnest(rolconfig) as setting from pg_roles where rolname = 'supabase_monitor_admin' order by 1;
1514 setting
1615----------------------------------------
1716 default_transaction_read_only=on
1817 idle_in_transaction_session_timeout=3s
1918 lock_timeout=3s
20- search_path=""
19+ search_path=pg_catalog, pg_temp
2120 statement_timeout=3s
2221 transaction_read_only=on
2322(6 rows)
@@ -55,10 +54,9 @@ select has_database_privilege('supabase_monitor_admin', current_database(), 'CRE
5554 f
5655(1 row)
5756
58- -- reads every table regardless of RLS, but cannot write. NOTE: this uses
59- -- SET SESSION AUTHORIZATION, which a future supautils impersonation guard
60- -- would block; switch to a probe role with identical grants when that lands
61- -- (see quick_explainer.md).
57+ -- reads every table regardless of RLS, but cannot write; SET ROLE to a
58+ -- predefined role only loses privileges (BYPASSRLS stays with
59+ -- supabase_monitor_admin)
6260create table public.monitor_probe (id int);
6361insert into public.monitor_probe values (1), (2);
6462alter table public.monitor_probe enable row level security;
@@ -73,6 +71,13 @@ select count(*) from public.monitor_probe;
7371
7472insert into public.monitor_probe values (3);
7573ERROR: permission denied for table monitor_probe
74+ set role pg_read_all_data;
75+ select count(*) from public.monitor_probe;
76+ count
77+ -------
78+ 0
79+ (1 row)
80+
7681reset session authorization;
7782drop table public.monitor_probe;
7883-- reserved role (supautils.conf.j2): the non-superuser postgres role cannot
0 commit comments