4 DROP ROLE — remove a database role
8 DROP ROLE [ IF EXISTS ] name [, ...]
12 DROP ROLE removes the specified role(s). To drop a superuser role, you
13 must be a superuser yourself; to drop non-superuser roles, you must
14 have CREATEROLE privilege and have been granted ADMIN OPTION on the
17 A role cannot be removed if it is still referenced in any database of
18 the cluster; an error will be raised if so. Before dropping the role,
19 you must drop all the objects it owns (or reassign their ownership) and
20 revoke any privileges the role has been granted on other objects. The
21 REASSIGN OWNED and DROP OWNED commands can be useful for this purpose;
22 see Section 21.4 for more discussion.
24 However, it is not necessary to remove role memberships involving the
25 role; DROP ROLE automatically revokes any memberships of the target
26 role in other roles, and of other roles in the target role. The other
27 roles are not dropped nor otherwise affected.
32 Do not throw an error if the role does not exist. A notice is
36 The name of the role to remove.
40 PostgreSQL includes a program dropuser that has the same functionality
41 as this command (in fact, it calls this command) but can be run from
51 The SQL standard defines DROP ROLE, but it allows only one role to be
52 dropped at a time, and it specifies different privilege requirements
57 CREATE ROLE, ALTER ROLE, SET ROLE