Unable to get pg_settings from non-postgres user

299 Views Asked by At

I have the following query to get the settings for max_running_jobs.

select *    
from pg_settings 
where name = 'cron.max_running_jobs';

I'm able to get the records from postgres user but not with the non-postgres user.

Any grant/permission I got missed?

1

There are 1 best solutions below

3
On

by this REF: https://pgpedia.info/p/pg_settings.html

the permission should be:

GRANT SELECT, UPDATE ON pg_settings TO PUBLIC;

you can confirm it running:

SELECT grantee, string_agg(privilege_type, ', ') AS privileges
FROM information_schema.role_table_grants 
WHERE table_name='pg_settings'   
GROUP BY grantee;