Updated on 2024-11-29 GMT+08:00

Deleting a User

Background

  • When running the DROP USER command to delete a user, you must use CASCADE to delete objects (except databases) that depend on the user. A user's locked objects can be deleted only after they are unlocked or the process that locks them is stopped.
  • A user on which databases depend can be deleted only after the databases are deleted. This is because databases are large objects and directly deleting them using CASCADE are risky.
  • In MOTService, the enable_kill_query parameter can be configured to determine whether to forcibly stop the process that locks a user's cascading objects to delete the user.
    • If it is set to true and CASCADE is used to delete a user, the system forcibly stops the process that locks the user's objects by default.
    • If it is set to false and CASCADE is used to delete a user, the system waits until the process that locks the user's cascading objects ends before deleting the user.

Procedure

  1. Log in to FusionInsight Manager, choose Cluster > Services > MOTService, click Instance, and view and record the service IP address of the MOTServer(Active) instance.
  2. Log in to the active MOTService node as user omm and run the following command to start environment variables:

    source ${MOTSERVER_HOME}/.motservice_profile

  3. Run the following command to connect to the MOTService database and enter the password of user omm:

    gsql -d postgres -p 20105

    Contact the system administrator to obtain the password of user omm for the MOTService database.

  4. Delete a user.

    For example, to delete the user joe, run the following command:

    DROP USER joe CASCADE;

    If the following information is displayed, the user has been successfully deleted:

    DROP ROLE