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.
Or using SQL (by a superuser):
SELECT pg_reload_conf();
Thanks Frank for that suggestion. I will update the article accordingly!
This does not work for all settings. See the postgres docs. Some parameters state: “This parameter can only be set at server start.”
Thanks.
I’m new to PostgreSQL and things like this makes life easier for me 🙂
Well it should be ….
pg_ctl reload -D /datafile-location
Thanks, very helpful.
SELECT pg_reload_conf();
Worked perfectly.
As others have stated, be sure your configuration changes don’t require a restart!
Cheers
Saved my homework. Thnks!
Thank you very much
thanks, you saved my day