Manual PostgreSQL configuration and tuning
Manually configure your self-hosted database using the PostgreSQL configuration file
If you prefer to tune settings yourself, or for settings not covered by
timescaledb-tune, you can manually configure your installation using the
PostgreSQL configuration file.
For some common configuration settings you might want to adjust, see the about configuration page.
For more information about the PostgreSQL configuration page, see the PostgreSQL documentation.
Edit the PostgreSQL configuration file
Section titled “Edit the PostgreSQL configuration file”The location of the PostgreSQL configuration file depends on your operating system and installation.
- Find the location of the config file for your instance
-
Connect to your database:
Terminal window psql -d "postgres://<username>:<password>@<host>:<port>/<database-name>" -
Retrieve the database file location from the database internal configuration.
SHOW config_file;PostgreSQL returns the path to your configuration file. For example:
--------------------------------------------/home/postgres/pgdata/data/postgresql.conf(1 row)
-
- Open the config file, then edit your PostgreSQL configuration
See the PostgreSQL documentation for details on available settings.
Terminal window vi /home/postgres/pgdata/data/postgresql.conf - Save your updated configuration
When you have saved the changes you make to the configuration file, the new configuration is not applied immediately. The configuration file is automatically reloaded when the server receives a
SIGHUPsignal. To manually reload the file, use thepg_ctlcommand.
Setting parameters at the command prompt
Section titled “Setting parameters at the command prompt”If you don’t want to open the configuration file to make changes, you can also
set parameters directly from the command prompt, using the postgres command.
For example:
postgres -c log_connections=yes -c log_destination='syslog'