How to change PostgreSQL User Password

In this article, we will see how to change PostgreSQL User Password with syntax and examples. We can change PostgreSQL User password by using alter database command.

Syntax to change PostgreSQL User/Role password:

alter user user_name with password 'NewPASSWORD'

1. Create User in PostgreSQL server.

CREATE USER karunakar with password 'karunakar@123';

2. Now change the password of PostgreSQL user using below command.

alter user karunakar with password 'admin@123';

How to change PostgreSQL User Password

With these steps we can change PostgreSQL User password in PgAdmin.