All settings are exposed through pg_settings
So you can query it:
select *
from pg_settings
where name like '%log%';
If you change a setting for one specific database, that value will show up in pg_settings
. The source
column's value "database" will indicate that the configuration value was set on database level. The value "user" will indicate it was set on the current user's level.
A short version of that is show
show log_destination;
Or you can use current_setting()
As e.g. the setting for the logfile might contain placeholders, you can query the active value through the function pg_current_logfile()
Many configuration settings can be changed online, but you need to "activate" them by reloading the configuration using pg_reload_conf()
Note that some settings are only visible to the superuser.