DO $$
DECLARE
  target_schema text := 'public';
  table_name    text;
BEGIN
  FOR table_name IN
    SELECT c.relname
    FROM pg_class c
    JOIN pg_namespace n ON n.oid = c.relnamespace
    WHERE n.nspname = target_schema
      AND c.relkind = 'r'
  LOOP
    EXECUTE format('ALTER TABLE %I.%I ENABLE ROW LEVEL SECURITY;', target_schema, table_name);
  END LOOP;
END $$;

REVOKE USAGE ON SCHEMA public FROM anon, authenticated;