Do you agree with modifying pgAdmin so that it stops converting the EOL
characters in the pgpass.conf file from unix-style (\n) to Windows-style
(\r\n)?
It works fine with unix-style line endings, and if the file is in that format
already, I think it should leave well enough alone.
The reason the issue came up is that I would like to be able to use one pgpass
file for both Windows applications (pgAdmin, psql under powershell, etc.) and
cygwin applications (/usr/bin/psql). I created a symlink from the pgpass.conf
file to .pgpass, and it works perfectly. Until, that is, I launch pgAdmin and
it adds the Windows carriage returns. Then, cygwin's psql stops working; it
seems to send the carriage return appended to the end of the password,
resulting in incorrect password errors.
For now, I can work around the problem by setting the pgpass.conf file to be
read-only at the filesystem level, forcing pgAdmin to stop updating it.
Apparently, unix-style EOL chars work everywhere (Windows and cygwin), while
Windows-style EOL chars only work in Windows. If a user wants Windows-style,
I'd say we should let them do it themselves with their text editor, not do it
for them behind the scenes.
You might wonder why I don't just work around the problem by only using the
Windows version of psql from within cygwin. The answer to that is because it
hangs under cygwin's mintty. I think it's due to the use of native windows
console functions, which aren't supported under mintty, as reported here:
http://stackoverflow.com/questions/13731384/
Another workaround would be to programatically generate the pgpass.conf from
the .pgpass file (or vice-versa), but that involves an extra step of work
every time the file is edited, just like my current workaround (overriding the
read-only every time I want to make a change).
I could also just not use cygwin, but as a long-term Linux user, I find that
when I am forced to use Windows, as in this case, it is significantly easier
for me to use cygwin than to learn all the Windows-equivalent commandline
tools, which in many cases do not even exist.
What do you think?
--
DB