I have a need to increase
wal_keep_segments on our master server. Can I do that on the fly or does it require a restart?
For checking the variable's context, you can execute the following query:
SELECT name, context FROM pg_settings WHERE name = '<variable name';
In the case of
wal_keep_segments, the context is
sighup which means that only requires a server reload. You can use
pg_ctl reload from the shell prompt or
select pg_reload_conf() from psql or database client.
In the latest version, there are 7 types of context.
internal context means that only can be modified at compilation time,
postmaster means that a service restart is needed, the others are more session/backend specific.
pg_ctl reload will send a
SIGHUP to the running processes and reload the setting. This should be run for any server that has the setting modified.