Re: psql and pgpass.conf on Windows

From: Kirk Wolak <wolakk(at)gmail(dot)com>
To: pf(at)pfortin(dot)com
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: psql and pgpass.conf on Windows
Date: 2023-07-01 05:40:49
Message-ID: CACLU5mTxsGTafjfo+cZXtV_y12=TdJE06Qp7mS2aR0YKBBcN2w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jun 30, 2023 at 8:39 AM <pf(at)pfortin(dot)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(at)pfortin(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Julien Rouhaud 2023-07-01 06:06:57 Re: psql and pgpass.conf on Windows
Previous Message Nathan Bossart 2023-06-30 21:56:08 Is anyone using db_user_namespace?