Postgresql – How to change PostgreSQL user password

change-passwordpostgresql

How do I change the password for PostgreSQL user?

Best Answer

To login without a password:

sudo -u user_name psql db_name

To reset the password if you have forgotten:

ALTER USER user_name WITH PASSWORD 'new_password';