[Fixed] pgadmin error when restoring database from tar file – Database

by
Ali Hasan
database pgadmin postgresql

Quick Fix: In pgAdmin, navigate to Databases > File > Preferences > Paths > Binary paths. Then, update the path to match your PostgreSQL installation directory, typically C:\Program Files\PostgreSQL\15\bin.

The Problem:

When attempting to restore a database from a tar file in pgAdmin, the process fails with exit code 3221225781. The error message suggests a missing dll, but the specific dll causing the issue remains unknown.

The Solutions:

Solution 1: Updating the Path in pgAdmin

  1. Open pgAdmin and navigate to Databases > File > Preferences > Paths > Binary paths.

  2. In the Binary paths section, edit the path to the PostgreSQL bin directory. The default path is:

C:\Program Files\PostgreSQL\15\bin.
  • You may need to modify the path according to your PostgreSQL version.
  1. Click OK to save the changes and restart pgAdmin.

  2. Attempt to restore the database from the tar file again. The error should be resolved.

This solution addresses the issue by updating the path to the PostgreSQL bin directory in pgAdmin. The previous error was likely due to an incorrect or missing path, which prevented pgAdmin from locating the necessary files to restore the database. By updating the path, pgAdmin can now access the required files and successfully restore the database.

Solution 2: Specify Correct Binary Path

If you face errors while restoring a database from a tar file using pgAdmin and receive exit code 3221225781, you need to ensure that the binary path specified in pgAdmin is correct. Here’s how to do it:

  1. Open pgAdmin and go to "File" > "Preferences."

  2. In the "Preferences" dialog, select the "Paths" tab.

  3. Under "Binary paths," select your PostgreSQL version from the dropdown menu.

  4. Change the "Binary Path" to the correct path where PostgreSQL is installed. For example, if you have PostgreSQL 16 installed, the path would be:

    C:\Program Files\PostgreSQL\16\bin
    
  5. Click "OK" to save the changes.

Now, try restoring the database again. The error should be resolved, and the operation should complete successfully.

Q&A

How to fix "exit code 3221225781" when restoring database?

Update the binary paths in pgAdmin’s preferences.

Where to find the binary path?

C:\Program Files\PostgreSQL\15\bin.

What if I have PostgreSQL 16?

In pgAdmin, change the binary path to C:\Program Files\PostgreSQL\16\bin.

Video Explanation:

The following video, titled "Unable to Restore/Import given Database | SQL | PostgreSQL ...", provides additional insights and in-depth exploration related to the topics discussed in this post.

Play video

PostgreSQL Create database ,Fix pg_restore error and Restore ... How To Take Backup Of Database As SQL/TAR File And How Restore Database In ...