From: pf@pfortin.com
To: pgsql-general@lists.postgresql.org
Subject: psql and pgpass.conf on Windows
Date: Thu, 29 Jun 2023 22:42:00 -0400
Message-ID: <20230629224200.080cc1a4.pfortin@pfortin.com> (raw)
Hi,
Trying to write a script that will run on Linux, Windows, and Mac.
The "standard" credentials file contains:
hostname:port:database:username:password
in:
Linux: .pgpass
Windows: %APPDATA%\postgresql\pgpass.conf
Mac: (I'm not there yet...)
On Linux, this works. However, on Windows, psql will not read
pgpass.conf (tried in just about every location I could think of)
Even: "set PGPASSFILE=<path to file>" does not work.
Finally, out of frustration, tried:
set PGPASSWORD=<password>
and that got me past the password issue, only to now get:
'more' is not recognized as an internal or external command,
operable program or batch file.
Given the number of queries about pgpass.conf and finding no answer that
works, is there no bug report on this?
Thinking that psql was not adjusted for Windows, tried naming the file:
.pgpass
.pgpass.conf
also in various locations to no avail...
What am I (and all the others found in searches) missing? Or are there
unresolved bugs in psql?
- pgpass.conf
- expecting external executable: 'more'
Thanks,
Pierre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: pf@pfortin.com
Subject: Re: psql and pgpass.conf on Windows
In-Reply-To: <20230629224200.080cc1a4.pfortin@pfortin.com>
References: <20230629224200.080cc1a4.pfortin@pfortin.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox