This topic describes how to lock or delete an account from an ApsaraDB RDS for PostgreSQL instance. If your RDS instance uses standard or enhanced SSDs, you can lock or delete an account by using the ApsaraDB RDS console or SQL statements. If your RDS instance uses local SSDs, you can only delete a standard account by using SQL statements.

Lock an account by using the ApsaraDB RDS console

Before you perform this operation, make sure that your RDS instance uses standard or enhanced SSDs.

Note After an account is locked, you cannot use the account to log on to your RDS instance.
  1. In the left-side navigation pane, click Accounts.
  2. Find the account that you want to lock, and click Lock Instance in the Actions column. In the message that appears, click OK.
    Note The account requires a few minutes to be locked. When the Status field displays Locking, the account is locked. If you want to use the account again, click Unlock in the Actions column.Lock an account

Delete an account by using the ApsaraDB RDS console

Before you perform this operation, make sure that your RDS instance uses standard or enhanced SSDs.

Note If an account has permissions on databases, tables, or other objects, this operation only locks the account. Before you delete the account, you must revoke the permissions of the account.
  1. In the left-side navigation pane, click Accounts.
  2. Find the account that you want to delete, and click Delete in the Actions column.
  3. In the message that appears, click OK.

Delete a standard account by using SQL statements

Note
  • If an account has permissions on databases, tables, or other objects, this operation only locks the account. Before you delete the account, you must revoke the permissions of the account.
  • This operation is supported regardless of whether your RDS instance uses local, standard, or enhanced SSDs.
  1. Use Alibaba Cloud Data Management (DMS) to log on to your RDS instance. For more information, see Use DMS to log on to an ApsaraDB RDS for PostgreSQL instance.
  2. In the top navigation bar, choose SQL Operations > SQL Window.
  3. Execute the following statement to assign 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>;
  4. Execute the following SQL statement to delete the account:
    DROP USER <The username of the account that you want to delete>;
  5. Click Execute.

Related operations

Operation Description
Delete database account Deletes an account from an ApsaraDB RDS instance.
Lock account Locks an account on an ApsaraDB RDS instance.
Unlock account Unlocks an account on an ApsaraDB RDS instance.