Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What permissions are required on the .pgpass file? #18

Open
will-e-yams opened this issue May 24, 2020 · 1 comment
Open

What permissions are required on the .pgpass file? #18

will-e-yams opened this issue May 24, 2020 · 1 comment

Comments

@will-e-yams
Copy link

will-e-yams commented May 24, 2020

I found this lib via brianc/node-postgres#455.

Can you clarify which permissions are required to read from the file?

From the postgres docs:

On Unix systems, the permissions on .pgpass must disallow any access to world or group; achieve this by the command chmod 0600 ~/.pgpass. If the permissions are less strict than this, the file will be ignored.

This is the way mine is set up and works in other scenarios. However the lib seems to not using the .pgpass file. Also, there is no error telling me of a permissions problem (graceful fallback?).

@hoegaarden
Copy link
Owner

If there is an issue with the file permissions, it should be logged to stderr, as you can e.g. see in the test output here.

image

If the pgpass does not moan about anything of that sorts and still the password is not used, you might check on the functions

if you can find something obvious why the pgpass file is not used in your case. One of my guesses is: It's in the wrong path?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants