Reset Postgres User Password
Resetting a Postgres user's password with alter role
is fine, but there is a better way! Try:
\password [ username ]
This changes the password of the specified user, defaulting to the current user. I like this because it prompts you for a password, encrypts it (security!), and sends it to the server as alter role
. Your password will not appear as cleartext in the command history, server log, or anywhere else.
h/t Jack Christensen
Tweet