PostgreSQL: How to change PostgreSQL user password?

Saad picture Saad · Oct 4, 2012 · Viewed 1.3M times · Source

How do I change the password for PostgreSQL user?

Answer

solaimuruganv picture solaimuruganv · Oct 4, 2012

For password less login:

sudo -u user_name psql db_name

To reset the password if you have forgotten:

ALTER USER user_name WITH PASSWORD 'new_password';