handlePgpass: warn about incorrect .pgpass permissions as psql does#595
Conversation
|
checks failed https://travis-ci.org/lib/pq/jobs/217185835 looks like an intermittent issue i don't understand https://travis-ci.org/lib/pq/jobs/217185858 |
|
I don't think it's kosher for a library to write to stderr like this. If we want warnings there should probably be a separate interface for that (but the sql.DB interface makes that a bit cumbersome, here, again). |
|
i agree that it's not nice for a library to log warnings this way. i couldn't find any mechanism that was already in use for warnings, though do you think this driver could either
|
|
then again, this is exactly what the official libpq does: |
|
@martinatsynqfm could you please take a look at this issue? Approach with PGPASSFILE on windows doesn't work at all because of incorrect permissions check mentioned in this PR. |
439274d to
a1adfc5
Compare
Write warning to stderr instead of silently not using it. Writing to stderr is not super great, but this is also what libpq does and for now it's better than nothing. Also skip this check on Windows, which is also what libpq does. See fe-connect.c Fixes lib#940
a1adfc5 to
967ca11
Compare
this implements the comment
i got confused today when trying to connect my program to a password-protected database. manually copying the password into the
Connectstring worked, but storing it in.pgpassdid not. when i checked with psql, i found my error, of course