Re: psql and pgpass.conf on Windows - Mailing list pgsql-general

From Kirk Wolak
Subject Re: psql and pgpass.conf on Windows
Date
Msg-id CACLU5mTxsGTafjfo+cZXtV_y12=TdJE06Qp7mS2aR0YKBBcN2w@mail.gmail.com
Whole thread Raw
In response to Re: psql and pgpass.conf on Windows  (pf@pfortin.com)
Responses Re: psql and pgpass.conf on Windows
List pgsql-general
On Fri, Jun 30, 2023 at 8:39 AM <pf@pfortin.com> wrote:
On Fri, 30 Jun 2023 11:16:36 +0800 Julien Rouhaud wrote:

>Hi,
>
>On Thu, Jun 29, 2023 at 10:42:00PM -0400, pf@pfortin.com wrote:
>>
>> Windows: %APPDATA%\postgresql\pgpass.conf
>>
 
echo %APPDATA%
C:\Users\Pierre\AppData\Roaming

>Now, since setting PGPASSFILE also doesn't work I start to wonder if there's
>another problem.  Does the password (or any other field) contain some non-ASCII
>characters? 

type %APPDATA%\postgresql\pgpass.conf
127.0.0.1:5432:ncsbe:postgres:<pw> 
 (only ASCII characters and no trailing space)
was using "localhost" before trying 127.0.0.1
even "*:*:..." failed.

Pierre, I use my pgpass .conf in windows.

copy that file to your current directory.
and set
PGPASSFILE=pgpass.conf

and try to get in.
Next, please specify the complete command line for psql you are using...
This way you know you are not passing in a strange variable.

If I set PGPASSFILE to a bad filename, I get a password prompt.

But the only time I've seen this was someone not specifying the dbname correctly.

FWIW, I discovered that psql is case sensitive on the dbname, without quoting it!

HTH,

Kirk

pgsql-general by date:

Previous
From: Nathan Bossart
Date:
Subject: Is anyone using db_user_namespace?
Next
From: Julien Rouhaud
Date:
Subject: Re: psql and pgpass.conf on Windows