Parameter changes not effective
When we change a parameter, but can't see the effect, there are quite a few possible reasons. Some parameters need a server restart. These are marked in the configuration file as follows:
# (change requires restart)
Then, there are parameters that can be set by a reload of the configuration file after making changes in the file. Reloading the parameters can be done using the following command:
pg_ctl reload
The same can be achieved by executing at psql:
SELECT pg_reload_conf();
We can know whether a server restart is required for a parameter change to take effect by querying pg_settings
:
postgres=# SELECT DISTINCT context FROM pg_settings; context ------------ backend user internal postmaster superuser sighup
If the context says postmaster
, then a restart of the cluster is required. However, if the context says sighup
, pg_ctl
a reload will do. For example:
SELECT name, context FROM pg_settings WHERE name IN ( 'archive_command','port'); name ...