Symptoms
-
An attempt to create a database server, or domain backup with a PostgreSQL database finishes with the following or similar warning:
Cannot run PostgreSQL client tools; make sure that they are installed: https://support.plesk.com/hc/en-us/articles/13302814628631. Unable to make database dump. Error: Unable to exec pg_dump: proc_open(): CreateProcess failed, error code: 2
-
An attempt to restore a server or domain backup with a PostgreSQL database included finishes with a similar warning:
'pg_restore.exe --file "backup_dbdump_2310230905.list" --list "backup_dbdump_2310230905"' is not recognized as an external or external command, operable program or batch file.
-
Running
pg_dump
, orpg_restore
in CLI shows a similar message:PS pg_dump
pg_dump : The term 'pg_dump' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1pg_dump
'pg_dump' is not recognized as an external or external command,
operable program or batch file.# pg_dump
-bash: pg_dump: command not found
Cause
PostgreSQL client tools are not installed or have not been added to the system PATH
variable.
Resolution
For Debian-based distributions (Ubuntu, Debian)
-
Connect to the server via SSH.
-
Install the corresponding package:
# apt install postgresql-client
For RHEL-based distributions (CentOS, AlmaLinux, Rocky Linux, CloudLinux, RHEL)
-
Connect to the server via SSH.
-
Install the corresponding package:
# yum install postgresql
For Windows
- Connect to the server via RDP.
- Download the PostgreSQL distribution from the official website.
- Run the MSI installer downloaded to install the PostgreSQL Client Tools component on the server.
- Go to Control Panel > System and Security > System > Advanced system settings > Environment Variables > System variables > and append the
PATH
environmental variable to the directory path where client tools were installed. - Restart Plesk services