pg_env.bat
on the host, I encountered the following error message when I ran psql
could not find a "psql" to execute
psql: could not find own program executable
It turns out that the quotation marks for path of the PostgreSQL binary from the batch file
pg_env.bat
is the culprit. For instance, the pg_env.bat
batch file on my Windows host has the following content,
@ECHO OFF
REM The script sets environment variables helpful for PostgreSQL
@SET PATH="C:\Program Files\PostgreSQL\9.6\bin";%PATH%
@SET PGDATA=L:\stackoverflow\Data
@SET PGDATABASE=postgres
@SET PGUSER=postgres
@SET PGPORT=5432
@SET PGLOCALEDIR=C:\Program Files\PostgreSQL\9.6\share\locale
To correct the problem, we need to remove the quotation marks from the "SET PATH" line, i.e., to change the file to the following,
@ECHO OFF
REM The script sets environment variables helpful for PostgreSQL
@SET PATH=C:\Program Files\PostgreSQL\9.6\bin;%PATH%
@SET PGDATA=L:\stackoverflow\Data
@SET PGDATABASE=postgres
@SET PGUSER=postgres
@SET PGPORT=5432
@SET PGLOCALEDIR=C:\Program Files\PostgreSQL\9.6\share\locale
You rock!! This totally fixed a problem I was having with a Skybot job in the office.
ReplyDeleteMuchas gracias!
ReplyDeleteThank you. This was very helpfull
ReplyDeleteThanks a lot. It worked like a charm
ReplyDeleteThank you!
ReplyDeleteThanks a lot!
ReplyDelete