Hi,
I haven't reviewed your patch, Not sure what would be expected
behaviour but the current one is documented in PostgreSQL
documentation [1], so there should not be any surprises for users.
"On Unix systems, the permissions on a password file must disallow any
access to world or group; achieve this by a command such as chmod 0600
~/.pgpass. If the permissions are less strict than this, the file will
be ignored. On Microsoft Windows, it is assumed that the file is
stored in a directory that is secure, so no special permissions check
is made."
Maybe it should be highlighted in documentation as a *Note* to put
some more emphasis?
[1] https://www.postgresql.org/docs/current/libpq-pgpass.html
--
Umar Hayat
SKAI Worldwide (https://skaiworldwide.com/)