I faced a task: find out minimal user permissions that I should grant to run a query:
select grantee, routine_name from information_schema.routine_privileges where routine_name in ('pg_read_file', 'pg_read_binary_file') group by grantee, routine_name;
I tried to grant
GRANT SELECT ON information_schema.routine_privileges TO <test_user>;
and I failed to get any result
If I run the query under the postgres user - I get all grantees corresponding routine_name
But what should I do to get those records under the test_user account ?
P.S. A remark: as I understood the information_schema.routine_privileges is a view:
so I granted a SELECT on tables: pg_proc, pg_namespace and pg_authid to my test_user
but still was unsuccesfull
P.P.S. It seems to me I have to troubleshoot: find out an object the user has insufficient access rights.. But how to find theese objects?