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.

mustaccio
  • 28,207
  • 24
  • 60
  • 76
M. Saleem Yusuf
  • 139
  • 1
  • 1
  • 5

3 Answers3

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

rjose
  • 103
  • 2
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.

John K. N.
  • 18,854
  • 14
  • 56
  • 117
M. Saleem Yusuf
  • 139
  • 1
  • 1
  • 5
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': '' 
} 
tinlyx
  • 3,810
  • 14
  • 50
  • 79