Home > database >  PhpStorm in Ubuntu can't detect pd_dump executable on PostgreSQL Export
PhpStorm in Ubuntu can't detect pd_dump executable on PostgreSQL Export

Time:04-20

My environment:

Ubuntu 20.04.3 LTS on Windows 10 -> Screenshot of the export window with error message

Inside of the window I get the error message "Path to executable is wrong" even tho the pg_dump file exists at the given path /usr/bin/pg_dump. This stops me from executing the export.

I have tried to manually install pg_dump in another directory and select it in the PhpStorm Export window, but it still won't detect the executable. The executable itself works fine.

CodePudding user response:

The solution to this problem was to do a sudo apt-get install postgresql-client.

Apparently there is a general problem with the pg_dump executable of the "postgresql-client-common" package: https://askubuntu.com/questions/501091/command-pg-dump-not-found

After installing the postgresql-client package, everything works fine in PhpStorm as well.

CodePudding user response:

The code is pretty simple there: IDE checks that file exists and is executable, then run /path/to/pg_dump --version command and parse output looking for some keywords. Unfortunately there are no logs which can show exact reason, but I guess the issue that IDE can't get access to the file. Most likely due to WSL. The workaround is to install IDE and unpack PG binaries on Windows, then configure port forwarding to make PG server accessible from host OS.

  • Related