-1

I made some changes in postgresql.conf file like modifying search_path and changing port. But these changes were not being reflected. They were written in the file but were not being implemented. I used vim for editing the file.

I did those changes separately using terminal commands and they worked but can anyone tell me the reason why modifying postgres.conf was not working?

  • Did you restart PostgreSQL after changing postgres.conf? – zedfoxus Jan 31 '23 at 14:42
  • Run `select name, context, setting, source, sourcefile from pg_settings where name in ('search_path', 'port');` to make sure you are working on the correct file. See [pg_settings](https://www.postgresql.org/docs/current/view-pg-settings.html) for more information. – Adrian Klaver Jan 31 '23 at 17:09
  • Can you show us the changes you've made in the file? – Matheus Farias Jan 31 '23 at 17:10

7 Answers7

1

Just don't forget to restart the server after changes in pg conf.

bin/pg_ctl -D {data-dir} restart
0

This happens sometimes because that changes was not stored/saved properly. So once you are done with the changes, save them and then run to make sure you are working on the correct file.

select name, context, setting, source, sourcefile from pg_settings where name in ('search_path', 'port');

Nimra Tahir
  • 391
  • 1
  • 6
0

The modifications you done to the postgresql.conf file might not have been implemented for a variety of reasons:

  1. Permissions: Check to see if you are granted the required permissions to edit the postgresql.conf file. In order to make modifications to the file, you might need to use sudo or run the text editor with administrator rights.

  2. File reloading: In order to have changes to postgresql.conf take effect, you must restart or reload the PostgreSQL service. Your updated configuration settings won't be used without a restart or reload. The command below can be used to restart PostgreSQL:

sudo service postgresql restart
0

You will have to restart the server for changes in postgresql.conf to take effect.

bin/pg_ctl -D <cluster> -l logfile stop
bin/pg_ctl -D <cluster> -l logfile start
Mohayu Din
  • 433
  • 9
0

After making changes in postgresql.conf, you need to restart the server for the changes to take effect.

Here's the command for restarting the server:

pg_ctl restart -D /path/to/data/directory
adil shahid
  • 125
  • 4
0

The configuration setting in the postgresql.conf are loaded during the start of the server. So you need to restart your server after modification. To do this just run the command.

bin/pg_ctl -D /path/to/data/directory restart

It can also be done without restarting.

  1. Run the command SELECT pg_reload_conf(); in the psql terminal
  2. Run the command bin/pg_ctl reload in the OS terminal
abhishek2046
  • 312
  • 1
  • 11
0

Here are some solutions that might help you.

  • Make sure changes are made to the intended file.
  • Make sure you have all permission to see the changes in this file.
  • Restart the server by using this command: pg_ctl restart -D /path/to/data/directory.