by codegeek · 7y ago · 0 comments
Honest question. If we should never use it, why have it in the first place as an option ? Is it some type of backward compatibility issue ? This list is great btw. Why we shouldn't do something is a great way to learn stuff.
> Why not?
> Even the manual tells you it's only implemented for SQL compliance.
> Don't use psql -W or psql --password
If I do a psql --help I see
Connection options:
-W, --password force password prompt (should happen automatically)
Nothing tells me I shouldn’t use it.> This option is never essential, since psql will automatically prompt for a password if the server demands password authentication. However, psql will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt.
So this is definitely confusing.
What they probably mean is that you shouldn't do something like --password=mypassword, which will work but is obviously dangerous to do.
If this happens you've lost already, -W or not.
.. which is what original doc says