PGPASS should be checked after all other methods
See original GitHub issueBasically I think the precedence should look like this, but we should probably see what the libpq behavior is (where relevant):
- Password in connection string
- Passfile in connection string
- Password callback (not so sure between this and 2 above)
- Password in environment variable
- Passfile in environment variable
- Default passfile
_Originally posted by @roji in https://github.com/npgsql/npgsql/pull/2657#discussion_r335412006_
The libpg
compatible way of getting the password:
- Password in connection string
- Password callback
- Password in environment variable
- Passfile in connection string
- Passfile in environment variable
- Default passfile
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (9 by maintainers)
Top Results From Across the Web
postgresql: .pgpass not working
pgpass in a user's home directory or the file referenced by PGPASSFILE can contain passwords to be used if the connection requires a...
Read more >ubuntu - .pgpass with postgreSQL not working
pgpass file must exist in the home directory of the user "using" it and must be readable only by that user. If these...
Read more >set the pgpass, still ask me password
when I type psql, it still promopt me to password. I thought all things are properly set. later I deleted the second password...
Read more >PostgreSQL: Documentation: 15: 34.16. The Password File
The file .pgpass in a user's home directory can contain passwords to be used if the connection requires a password (and no password...
Read more >Documentation: 15: pg_amcheck
pg_amcheck supports running amcheck's corruption checking functions against one or more databases, with options to select which schemas, tables and indexes to ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think that the connection string should in general take precedence over programmatic means - this allows users to use the same program/code and select behavior as they want without recompiling or programmatic switching logic.
#2500 was made because:
It adds some logic into the driver which actually can be done outside of it by excluding the password from the pool key (and maybe other options too).