You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation states that if certain arguments are NULL, a .pgpass or pgpass.conf file will be used to get the username and password. However I don't seem to be able to make this work, even when explicitly setting the passfile argument when making the connection.
R can definitely find the file just fine, and I suppose I could resort to manually loading the file. However I am unsure as to why this seems to fail.
I have other clients on the same system that use the pgpass method of authentication with no trouble.
I found it helpful to try to connect to a local postgres instance. The docs state that you can replace of the elements with an asterisk, effectively matching anything. It maybe helpful to add a line like hostname:port:*:*password to .pgpass to match against any database & user to pinpoint the issue?
Also, it may be worthwhile to the check the permissions on .pgpass if you're on linux (see docs).
Admittedly the error message (failed: fe_sendauth: no password supplied) can be a bit misleading when trying to get the config right.
Activity
toppyy commentedon Nov 27, 2025
I was able to connect with
.pgpass.I found it helpful to try to connect to a local postgres instance. The docs state that you can replace of the elements with an asterisk, effectively matching anything. It maybe helpful to add a line like
hostname:port:*:*passwordto.pgpassto match against any database & user to pinpoint the issue?Also, it may be worthwhile to the check the permissions on
.pgpassif you're on linux (see docs).Admittedly the error message (
failed: fe_sendauth: no password supplied) can be a bit misleading when trying to get the config right.