@@ -40,29 +40,35 @@ where r.rolname = 'supabase_auth_admin';
40
40
{search_path=auth,idle_in_transaction_session_timeout=60000,log_statement=none}
41
41
(1 row)
42
42
43
- -- auth schema tables with owners
43
+ -- auth schema tables with owners and rls policies
44
44
select
45
- n .nspname as schema_name,
45
+ ns .nspname as schema_name,
46
46
c.relname as table_name,
47
- r.rolname as owner
47
+ r.rolname as owner,
48
+ c.relrowsecurity as rls_enabled,
49
+ string_agg(p.polname, ', ' order by p.polname) as rls_policies
48
50
from
49
51
pg_class c
50
52
join
51
- pg_namespace n on c.relnamespace = n .oid
53
+ pg_namespace ns on c.relnamespace = ns .oid
52
54
join
53
55
pg_roles r on c.relowner = r.oid
56
+ left join
57
+ pg_policy p on p.polrelid = c.oid
54
58
where
55
- c.relkind in ('r') -- 'r' for regular tables
56
- and n.nspname = 'auth'
59
+ ns.nspname = 'auth'
60
+ and c.relkind = 'r'
61
+ group by
62
+ ns.nspname, c.relname, r.rolname, c.relrowsecurity
57
63
order by
58
64
c.relname;
59
- schema_name | table_name | owner
60
- -------------+-------------------+---------------------
61
- auth | audit_log_entries | supabase_auth_admin
62
- auth | instances | supabase_auth_admin
63
- auth | refresh_tokens | supabase_auth_admin
64
- auth | schema_migrations | supabase_auth_admin
65
- auth | users | supabase_auth_admin
65
+ schema_name | table_name | owner | rls_enabled | rls_policies
66
+ -------------+-------------------+---------------------+-------------+--------------
67
+ auth | audit_log_entries | supabase_auth_admin | f |
68
+ auth | instances | supabase_auth_admin | f |
69
+ auth | refresh_tokens | supabase_auth_admin | f |
70
+ auth | schema_migrations | supabase_auth_admin | f |
71
+ auth | users | supabase_auth_admin | f |
66
72
(5 rows)
67
73
68
74
-- auth indexes with owners
0 commit comments