You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何解决PGAdmin4备份数据库时pg_dump.exe路径错误且修改后自动变更的问题

Fix: PGAdmin4 Keeps Resetting Binary Path to Duplicate pg_dump.exe

I’ve run into this exact frustrating issue before—PGAdmin keeps appending the executable name twice because of a misconfigured binary path. Here’s how to fix it step by step:

1. Correct the Binary Path in Preferences (The Right Way)

The core problem is you’re probably setting the path to the pg_dump.exe file directly, but PGAdmin expects the parent bin directory (it auto-adds the executable names on its own).

  • Open PGAdmin4, go to File > Preferences > Paths > Binary Paths
  • For your PostgreSQL 14 entry, set the path to:
    C:\Program Files\PostgreSQL\14\bin
    
    Do NOT include \pg_dump.exe at the end—that’s exactly why you’re getting the duplicate pg_dump.exe\pg_dump.exe error.
  • Click Save and restart PGAdmin4 to test if the backup works.

2. Manually Edit the PGAdmin Config File (If GUI Settings Won’t Stick)

Sometimes permission issues or corrupted configs prevent PGAdmin from saving your preferences. Here’s how to edit the config directly:

  • Close PGAdmin4 completely.
  • Open File Explorer and navigate to:
    %APPDATA%\pgAdmin
    
  • Open the pgAdmin4.conf file with a text editor (like Notepad++ or even plain Notepad).
  • Look for lines starting with BinaryPaths—you’ll likely see something broken like:
    BinaryPaths={'PostgreSQL 14': 'C:\\Program Files\\PostgreSQL\\14\\bin\\pg_dump.exe'}
    
  • Modify it to point only to the bin directory:
    BinaryPaths={'PostgreSQL 14': 'C:\\Program Files\\PostgreSQL\\14\\bin'}
    
  • Save the file, then restart PGAdmin4. Your path should stay correct now.

3. Fix Permission Issues

If the config keeps reverting even after editing the file, PGAdmin might not have permission to save changes:

  • Right-click your PGAdmin4 shortcut and select Run as administrator.
  • Go back to the Binary Path preferences, set the correct bin directory, save, and restart.
  • This ensures PGAdmin can write to its config files without restrictions.

4. Reinstall PGAdmin4 (Last Resort)

If none of the above works, a corrupted installation might be the culprit:

  • Uninstall PGAdmin4 from Settings > Apps > Apps & features.
  • Download the latest compatible version of PGAdmin4 (match your PostgreSQL 14 version) from the official PostgreSQL website.
  • During installation, when prompted to set binary paths, make sure to select the C:\Program Files\PostgreSQL\14\bin directory, not the executable file.

内容的提问来源于stack exchange,提问作者Labaks.

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.01 02:47:47