PostgreSQL: How to reload config settings without restarting database

postgresql reset statistics, pg_stat_reset

If you are making modifications to the Postgres configuration file postgresql.conf (or similar), and you want to new settings to take effect without needing to restart the entire database, there are two ways to accomplish this. Another similar command essential to PostgreSQL, is to reload pg_hba.conf.

Option 1: From the command-line shell

su - postgres
/usr/bin/pg_ctl reload

Option 2: Using SQL

SELECT pg_reload_conf();

Using either option will not interrupt any active queries or connections to the database, thus applying these changes seamlessly.

See also  How to Enable PostgreSQL Performance Logging

10 thoughts on “PostgreSQL: How to reload config settings without restarting database”

  1. This does not work for all settings. See the postgres docs. Some parameters state: “This parameter can only be set at server start.”

  2. SELECT pg_reload_conf();
    Worked perfectly.

    As others have stated, be sure your configuration changes don’t require a restart!


Leave a Comment