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. If Locking is displayed in the Status column of the account, the account is locked.
NoteTo use a locked account again, click Unlock in the Actions column of the account.
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>;
FAQ
When I delete an account of an RDS instance in the ApsaraDB RDS console, an error message is displayed. The error message indicates that database objects depend on the account and the account can be deleted only after the dependency is removed. The error code is AccountActionForbidden
. What do I do?
If you delete an account on which database objects of the RDS instance depend, the deletion fails. You must identify the objects that depend on the account and delete the objects.
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.