
When the instance is started, it first reads the configuration file and opens the instance
according to the values set in the parameters.
postgresql.conf: When the cluster is created (initdb), it is created in the data folder by
default.
Text is a file.
The file directory may differ depending on the version.
In systems such as Enterprise Linux (OEL, RHEL, Scientific) it is included in $PGDATA.
In Debian, Ubuntu Linux it is located in /etc/postgresql directory.
postgresql.auto.conf : It is located in the data folder. It is not recommended to change
it manually or by different applications. Settings made with “alter system”
sentences are written here. It is an overriding settings file. If a value is entered for the
same parameter in both files, the value in postgresql.auto.conf file will be
considered.
# Step 1 /pg/home/13.6/bin/pg_ctl -D /pg/data/13.6/ -l logfile start waiting for server to start.... stopped waiting pg_ctl: could not start server Examine the log output. # Step 2 postgres@srv1:~$ cat logfile LOG: database system is shut down postgres: could not access the server configuration file "/pg/data/13.6/postgresql.conf": No such file or directory # Step 3 mv /pg/data/13.6/postgresql-conf /pg/data/13.6/postgresql.conf /pg/home/13.6/bin/pg_ctl -D /pg/data/13.6/ -l logfile start waiting for server to start.... done server started /pg/home/13.6/bin/pg_ctl -D /pg/data/13.6/ status pg_ctl: server is running (PID: 16432) /pg/home/13.6/bin/postgres "-D" "/pg/data/13.6"
In Step 1, It gives an error when trying to open instance.
In Step 2, when we examined the log file, we found that it could not find the
configuration file.
In Step 3, changing the name of the postgresql-conf file to postgresql.conf solves the
problem.
The ‘—config’ parameter is used to open a specific conf file.
pg_ctl -o '--config-file=/../postgresql.conf' -D /pg/data/13.6/