As we discussed in the previous recipes, the location of a configuration file defaults to different locations, depending on the OS distribution that PostgreSQL was installed on. However, you may wish to modify this location for various reasons, such as maintaining a standard location, as decided by your organization, or to put all the configuration files and scripts in a directory that is frequently backed up. In this recipe, we shall discuss the steps involved in modifying the default location of a postgresql.conf file.
Getting ready
To modify the default location of a postgresql.conf file, it is important to have a safe location that can be accessed by a Postgres user. It is also important to periodically back up this configuration file if it is not part of the data directory. If the configuration files are not backed up along with the data directory, we may have to start with an untuned PostgreSQL server when we need...