pg_reload_conf() (v14 documentation, also see documentation on pgPedia) tells you nothing about whether the configuration is valid. Rather, it just sends a SIGHUP to the Postgres process, causing it to reload the configuration. The return value of
pg_reload_conf() merely tells you if this signalling attempt was successful, not whether the config is valid. If the configuration is bad, Postgres will still load it, but only the valid lines will take effect.
Given this, there is no reason to use
pg_reload_conf() over the preferred method of reloading the service in Debian/Ubuntu, which is to do so via SystemD:
systemctl reload postgresql. Both that and
pg_reload_conf() perform the same task.
To check the validity of the configuration files, there are a few views:
Select all records from one of these views to see the validity of each line in each config file that is parsed. Refer to the documentation linked above to see what info is provided by each view.
pg_file_settings, there is a column
applied which is
true iff the config line is valid. Thus:
- to see whether the entire config is valid:
SELECT bool_and(applied) FROM pg_file_settings;
- to see which lines are invalid and why:
SELECT * FROM pg_file_settings WHERE NOT applied;
pg_hba_file_rules, there is a column
error which is
NULL iff the config line is valid. Thus: