If an account of your ApsaraDB RDS for PostgreSQL instance is not in use, you can lock the account in the ApsaraDB RDS console. If the account is no longer required, you can delete the account.
Lock an account
After an account is locked, you cannot use the account to log on to your RDS instance.
- Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
In the left-side navigation pane, click Accounts.
Find the account that you want to lock, and click Lock in the Actions column. In the message that appears, click OK.
NoteThe account requires a few minutes to be locked. If Locking is displayed in the Status column of the account, the account is locked. If you want to use the account again, click Unlock in the Actions column.
Delete an account
If the account that you want to delete is granted permissions on databases, tables, or other objects, the
Some objects depend on account
error message is displayed when you attempt to delete the account. You can delete the account only after you remove the permissions of the account.You can delete privileged and standard accounts in the ApsaraDB RDS console.
You can delete only standard accounts by using SQL statements.
Delete a privileged account or a standard account in the ApsaraDB RDS console
- Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
In the left-side navigation pane, click Accounts.
Find the account that you want to delete, and click Delete in the Actions column.
In the message that appears, click OK.
Delete a standard account by using SQL statements
Connect to your RDS instance. For more information, see Connect to an ApsaraDB RDS for PostgreSQL instance.
Execute the following SQL statement to grant the permissions of the account to another account:
REASSIGN OWNED BY <The username of the account that you want to delete> TO <The username of another account>;
Execute the following SQL statement to delete the account:
DROP USER <The username of the account that you want to delete>;
References
After the deletion, you can create an account again. For more information, see Create an account.
You can call API operations to lock and delete accounts.
Operation
Description
Deletes an account.
Locks an account.
Unlocks an account.