Re: [GENERAL] Preventing psql from attempting to access ~/.pgpassfile. - Mailing list pgsql-general

From Justin Pryzby
Subject Re: [GENERAL] Preventing psql from attempting to access ~/.pgpassfile.
Date
Msg-id 20171017061931.GA13880@telsasoft.com
Whole thread Raw
In response to [GENERAL] Preventing psql from attempting to access ~/.pgpass file.  (Allan Kamau <kamauallan@gmail.com>)
List pgsql-general
On Tue, Oct 17, 2017 at 09:06:59AM +0300, Allan Kamau wrote:
> Is there a way to instruct psql not to try reading ~/.pgpass file?

https://www.postgresql.org/docs/current/static/libpq-envars.html
PGPASSFILE behaves the same as the passfile connection parameter.
passfile
Specifies the name of the file used to store passwords (see Section 33.15). Defaults to ~/.pgpass, or
%APPDATA%\postgresql\pgpass.confon Microsoft Windows. (No error is reported if this file does not exist.)
 

https://www.postgresql.org/docs/9.6/static/libpq-envars.html
PGPASSFILE specifies the name of the password file to use for lookups. If not set, it defaults to ~/.pgpass (see
Section31.15).
 

verifying it doesn't access the default:
pryzbyj@pryzbyj:~$ echo quit |PGPASSFILE=/nonextant strace psql 2>&1 |grep -E 'nonex|pgpass'
stat("/nonextant", 0x7fffbd13c9f0)      = -1 ENOENT (No such file or directory)
pryzbyj@pryzbyj:~$ 


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: [GENERAL] Making subscribers read only in Postgres 10 logical replication
Next
From: Murtuza Zabuawala
Date:
Subject: Re: [GENERAL] Preventing psql from attempting to access ~/.pgpass file.