Table of Contents Previous Next


3 The SQL Language : 3.3 SQL Commands : 3.3.52 DROP USER

3.3.52 DROP USER
DROP USER -- remove a database user account
DROP USER name [ CASCADE ]
DROP USER removes the specified user. To drop a superuser, you must be a superuser yourself; to drop non-superusers, you must have CREATEROLE privilege.
However, it is not necessary to remove role memberships involving the user; DROP USER automatically revokes any memberships of the target user in other roles, and of other roles in the target user. The other roles are not dropped nor otherwise affected.
Alternatively, if the only objects owned by the user belong within a schema that is owned by the user and has the same name as the user, the CASCADE option can be specified. In this case the issuer of the DROP USER name CASCADE command must be a superuser and the named user, the schema, and all objects within the schema will be deleted.
To drop user account, john, who has not been granted any privileges on any objects, and does not own any objects outside of a schema named, john, that is owned by user, john:

3 The SQL Language : 3.3 SQL Commands : 3.3.52 DROP USER

Table of Contents Previous Next