User passwords are stored in the system catalog pg_authid. To prevent password leakage, GaussDB(DWS) encrypts and stores the user passwords.
The password complexity requirements are as follows:
A password must contain at least three types of the preceding characters (uppercase letters, lowercase letters, digits, and special characters).
When a user changes the password, the user can reuse a password only if it has not been used for over 60 days.
A validity period (90 days by default) is set for each database user password. If the password is about to expire (in seven days), the system displays a message reminding the user to change it upon login.
Considering the usage and service continuity of a database, the database still allows a user to log in after the password expires. A password change notification is displayed every time the user logs in to the database until the password is changed.
Change the password as prompted.
For example, to change the password of the user user1, connect to the database as the administrator and run the following command:
1 | ALTER USER user1 IDENTIFIED BY "1234@abc" REPLACE "5678@def"; |
1234@abc and 5678@def represent the new password and the original password of the user user1, respectively. The new password must conform to the complexity rules. Otherwise, the new password is invalid.
To change the password of the user joe, run the following command:
1 | ALTER USER joe IDENTIFIED BY 'password'; |
Password verification is required when you set the user or role in the current session. If the entered password is inconsistent with the stored password of the user, an error is reported.
To set the password of the user joe, run the following command:
1 | SET ROLE joe PASSWORD 'password'; |