Cenk KurtoğluRLS Audit Kit →

Free SQL sample · Read-only · PostgreSQL catalog

See which tables have RLS before you inspect the policies.

This query lists ordinary and partitioned tables, whether Row Level Security is enabled, whether it is forced for the owner, and how many policies exist. It changes nothing.

rls-coverage-sample.sqlSELECT only
select
  n.nspname as schema_name,
  c.relname as table_name,
  c.relrowsecurity as rls_enabled,
  c.relforcerowsecurity as rls_forced,
  count(p.polname) as policy_count
from pg_class c
join pg_namespace n on n.oid = c.relnamespace
left join pg_policy p on p.polrelid = c.oid
where c.relkind in ('r', 'p')
  and n.nspname not in ('pg_catalog', 'information_schema', 'pg_toast')
  and n.nspname not like 'pg_temp%'
group by n.nspname, c.relname, c.relrowsecurity, c.relforcerowsecurity
order by c.relrowsecurity asc, policy_count asc, n.nspname, c.relname;

How to read the result

  • rls_enabled = false: PostgreSQL is not applying an RLS row filter.
  • policy_count = 0: RLS-enabled tables default to deny for roles subject to RLS.
  • rls_forced = false: the table owner normally bypasses RLS.

What it does not prove

RLS status alone does not prove exposure or safety. Review grants, exposed schemas, policy expressions, write checks, views, security-definer functions, Storage, Realtime and real cross-user behavior.

Continue the review

Seven SQL audits and 60 checks

The paid kit adds policy, write-gate, grant, bypass, Storage, Realtime and role-simulation audits plus a two-user staging harness and report templates.

Get the kit — $29 ↗

Run this only against a database you own or are authorized to inspect. The query is a diagnostic starting point, not a penetration test, certification or security guarantee. This page is the free sample; the remaining kit files retain their commercial license and are not publicly redistributed.