4
postgresql.conf
Main configuration file
loaded when the server starts
option to load additional configuration files
located in the data directory (PGDATA) by default
/etc/postgresql/16/main
After any changes to the parameters, the file has to be reloaded
$ pg_ctl reload
$ pg_ctlcluster 16 main reload
=> SELECT pg_reload_conf();
changes to some parameters require a server restart to apply
The main configuration file is postgresql.conf.
The default file’s location is defined during initial PostgreSQL compilation. The
server executable accepts -c config_file as a command line argument to set the
configuration file path.
By default, the file is located in the data catalog (PGDATA), but package
distributions usually place it somewhere else, depending on the OS-specific
conventions.
This is a well-documented plaintext file which stores parameters in a key-value
format.
Additional configuration files can be included. By default, PostgreSQL on Ubuntu
automatically includes all .conf files from /etc/postgresql/16/main/conf.d.
If the same parameter is defined in the configuration files multiple times, only the
most recently read value will be used.
For any changes to parameters to apply, the file must be reloaded. Some
parameters require a server restart to apply.