Introduction
If PostgreSQL is unable to start and a similar error is shown as below, this means that there is an issue with the variables noted in error preventing the service from starting:
Aug 07 14:42:03 server systemd[1]: postgresql.service: control process exited, code=exited status=1
Aug 07 14:42:03 server systemd[1]: Failed to start PostgreSQL database server.
Aug 07 14:42:03 server systemd[1]: Unit postgresql.service entered failed state.
Aug 07 14:42:03 server systemd[1]: postgresql.service failed.
Aug 07 14:48:03 server systemd[1]: Starting PostgreSQL database server...
Aug 07 14:48:03 server pg_ctl[38211]: LOG: configuration parameter «min_wal_size» not recognized in file «/var/lib/pgsql/data/postgresql.conf» line 591
Aug 07 14:48:03 server pg_ctl[38211]: LOG: configuration parameter «max_wal_size» not recognized in file «/var/lib/pgsql/data/postgresql.conf» line 592
Aug 07 14:48:03 server pg_ctl[38211]: LOG: configuration parameter «max_worker_processes» not recognized in file «/var/lib/pgsql/data/postgresql.conf» line 593
Aug 07 14:48:03 server pg_ctl[38211]: LOG: configuration parameter «max_parallel_workers_per_gather» not recognized in file «/var/lib/pgsql/data/postgresql.conf» line 59
Aug 07 14:48:03 server pg_ctl[38211]: LOG: configuration parameter «max_parallel_workers» not recognized in file «/var/lib/pgsql/data/postgresql.conf» line 595
Aug 07 14:48:03 server pg_ctl[38211]: LOG: configuration parameter «max_parallel_maintenance_workers» not recognized in file «/var/lib/pgsql/data/postgresql.conf» line 5
Aug 07 14:48:03 server pg_ctl[38211]: FATAL: el archivo de configuración «/var/lib/pgsql/data/postgresql.conf» contiene errores
Procedure
First, you want to make sure that the variables are correctly spelled and that it can be used in the version of PostgreSQL that you are using. This can be checked at the link below by entering the desired variable:
https://postgresqlco.nf/en/doc/param/
While you can check your PostgreSQL version with the following command:
postgres -V
When PostgreSQL is installed via the cPanel script, the version that will be installed is set by OS version:
Centos 7 = PostgreSQL 9.2
Centos 6 = PostgreSQL 8.6
In the case that the variables are not available in the above versions, they will need to be removed or Postgres updated. However, please be aware that cPanel will only provide support to the versions provided by cPanel.