     RETURN pw;
 END
 $function$
-SECURITY DEFINER;
+SECURITY DEFINER SET search_path to 'pg_catalog';
 
 REVOKE ALL ON FUNCTION create_application_user(text) FROM public;
 GRANT EXECUTE ON FUNCTION create_application_user(text) TO admin;

    SELECT c FROM chars, generate_series(1, length) ORDER BY random()
)
SELECT substr(string_agg(b, ''), 1, length) FROM bricks;
$$;

CREATE OR REPLACE FUNCTION create_application_user(username text)
 RETURNS text

    EXECUTE format($$ REVOKE admin FROM %I $$, username);
END
$function$
SECURITY DEFINER SET search_path to 'pg_catalog';

REVOKE ALL ON FUNCTION revoke_admin(text) FROM public;
GRANT EXECUTE ON FUNCTION revoke_admin(text) TO admin;
