10

I am new to PostgreSQL. I installed the software. Almost everything works. Then I tried to follow a tutorial for dvdrental. All instructions for using from command line worked. Then there is instruction for creating a DB using pgAmdin 4, which also worked. The next instruction is to do a restore. This fails. The error message is

'C:\Program Files\PostgreSQL\13\pgAdmin 4\runtime\pg_restore.exe' file not found. Please correct the Binary Path in the Preferences dialog.

The message is correct. pg_restore.exe is not in the runtime folder, the runtime folder does not exist. There is a bin folder and pg_restore.exe is that directory.

I tried various things, such as changing "EDB Advanced Server Binary Path", I also created folder runtime and copied everything that was in the bin folder to runtime, but it still will not work. This looks like an installation problem. Same message seemed to have appeared for years, but none of those solutions have worked for me. I would appreciate any help.

3 Answers 3

12

Yes, the pg_restore.exe is in this location - C:\Program Files\PostgreSQL\13\bin. Go to File-> Preferences-> Paths->Binary paths

Change PostgreSQL Binary Path to "C:\Program Files\PostgreSQL\13\bin"

enter image description here

2
  • The author already stated that he tried something like that, but probably entered it into the wrong field. This answer isn't detailed enough. I also tried to change the binary path in preferences, but that did not work at first. Specifically it is the PostgreSQL Binary Path that needs to be changed and not the EDB advanced server binary path.
    – shawn1874
    Commented Jul 28, 2021 at 23:54
  • This solved an error that I was running into when trying to back up my PostgreSQL database. Thanks!
    – KBurchfiel
    Commented May 29 at 18:54
3

I was able to fix (or patch) the problem by copying files.

  1. Searched for pg_restore.exe from folder C:\Program Files\PostgreSQL\13\. I found the file in C:\Program Files\PostgreSQL\13\bin.

  2. Then I copied all the files from C:\Program Files\PostgreSQL\13\bin folder to C:\Program Files\PostgreSQL\13\pgAdmin 4\runtime where the error message says file is missing. Note: After installation, there was no runtime folder. I had to create it.

The error went away and restore seems to work. I am not sure this is the right solution, but for now, it works.

2
  1. Goto: C:\Program Files\PostgreSQL\13\pgAdmin 4\web

  2. Open config_distro file

  3. Change default binary path for of pg to bin of PostgreSQL server's bin folder

    Orignal:

 DEFAULT_BINARY_PATHS = { 
   'pg':   '$DIR/../runtime', 
   'ppas': '' 
} 

To

DEFAULT_BINARY_PATHS = { 
   'pg':   '$DIR/../../bin', 
   'ppas': '' 
} 
1
  • 1
    This appears to have the same effect as selecting file-> preferences and changing the PostgreSQL Binary Path setting. The value you recommended worked for me, but changing it in the GUI seems a bit easier and less error prone then directly modifying a configuration file.
    – shawn1874
    Commented Jul 28, 2021 at 23:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.