GeezerVison is showing github.com — pgadmin version 9.19 Desktop can not run run PSQL tool Binary path set up good. As query tool and export import works · Issue #10796 · pgadmin-org/pgadmin4
pgadmin version 9.19 Desktop can not run run PSQL tool Binary path set up good. As query tool and export import works #10796DescriptionPlease note that security bugs or issues should be reported to [email protected].
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- See the error
Expected behavior
A clear and concise description of what you expected to happen.
Error message
If possible, include the full, unedited text of any error messages displayed.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. Windows 10, OSX monterey]
- pgAdmin version: [e.g. 6.15]
- Mode: [e.g Desktop or Server]
- Browser (if running in server mode): [e.g. chrome, safari]
- Package type: [e.g. RPM, DEB, Python, Container, etc.]
Additional context
Add any other context about the problem here. Activitysk-susi commented on Nov 18, 2026 could not find a "" to execute
could not find a "" to execute
: error: could not find own program executable cartomaniac commented on Nov 18, 2026 I ran into this exact same issue on Windows (pgAdmin 4 v9.19 Desktop with bundled psql 18.6 in pgAdmin4\runtime).
Root Cause
In web/pgadmin/tools/psql/__init__.py inside windows_platform(), PtyProcess.spawn(connection_data, env=get_user_env(env)) spawns psql.exe directly via pywinpty with an empty argv (""). Because argv is blank, PostgreSQL's find_my_exec() fails to locate its own executable—even when the Binary Path is properly configured and added to Windows PATH.
Verified Workaround
Wrapping the command with cmd.exe /c inside windows_platform() ensures Windows populates argv properly before psql.exe executes:
def windows_platform(connection_data, sid, max_read_bytes, server_id,
env=None):
try:
cmd = ['cmd.exe', '/c', connection_data[0], connection_data[1]]
process = PtyProcess.spawn(cmd, env=get_user_env(env))
With this change in web/pgadmin/tools/psql/__init__.py (and restarting pgAdmin 4), the PSQL Tool connects cleanly. spageRDG commented on Nov 20, 2026 I just ran into the same issue.
After making the edit suggested by @cartomaniac, i received this error:
'C:\Users\%username%\AppData\Local\Programs\pgAdmin' is
not recognized as an internal or external command
,
operable program or batch file.
dpage commented on Nov 26, 2026 Thanks for the reports and the digging, @cartomaniac. 9.19 spawned psql.exe with an empty argv[0], which is why find_my_exec() fails with "could not find own program executable". This is fixed on master for the next release: #10779 moved to pywinpty 3.1.2, which puts the quoted executable path on the command line itself (so paths under C:\Program Files no longer split, which is the error @spageRDG saw after the manual edit), and the PSQL tool no longer relies on a blank argv[0]. Please try 9.20 once it's out, and let us know here if it still fails.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|