I set up a postgres DB on my server, logged in with postgres (PEER Method), created another user and than want to set an encrypted password for the new user.
The most tutorials I find say, that you can change the password by:
ALTER USER other_user WITH ENCRYPTED PASSWORD 'passwd';
But it does not really feel good to enter the password clear into the sql console. It is saved in the history, and everybody can see it.
Is this really the right way to set a password in postgres?
I have a ~/.pgpass in my home :
and the query file password.txt :
and run this command:
Remember: