Search code examples
pgadmin-4

"[Errno 2] No such file or directory" when trying to backup a database in pgAdmin4


I have finally managed to get around managing to manually set "PostgreSQL Binary Path" in preferences (why should the user have to do this when it wasn't necessary in pgAdmin3?).

Though to be honest, I have no idea what is meant with the second path field called "EDB Advanced Server Binary Path". But I get no more error message concerning that so I assume it is o.k. to leave that empty.

Now I am stuck on the next step.

When trying to backup the database I have to enter a filename. No matter what I do here, I keep getting this error:

[Errno 2] No such file or directory

Well, it can not be that I have to create a file before it is created by pgAdmin, can it?

What could I be doing wrong?

Alex


update: answering to @n33rma here are the print screens:

path setting with corrected path backup setting backup failing


Solution

  • I solved the problem through the command line.

    If we use a previous format, it has the same response as you had:

    $ pg_restore -d <DBNAME> --username=postgres g=<FILENAME> 
    pg_restore: [archiver] could not open input file "g=<FILENAME>": No such file or directory
    

    If we change the last param, it works properly:

    $ pg_restore -d <DBNAME> --username=postgres <FILENAME>
    

    I suppose the GUI-command changed in v4, but the console pg_restore is not.