{
    "mode": "man",
    "parameter": "DROP_ROLE",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/man/DROP_ROLE/json",
    "generated": "2026-11-12T04:46:13Z",
    "synopsis": "DROP ROLE [ IF EXISTS ] name [, ...]",
    "sections": {
        "NAME": {
            "content": "DROPROLE - remove a database role\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "DROP ROLE [ IF EXISTS ] name [, ...]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "DROP ROLE removes the specified role(s). To drop a superuser role, you must be a superuser\nyourself; to drop non-superuser roles, you must have CREATEROLE privilege and have been\ngranted ADMIN OPTION on the role.\n\nA role cannot be removed if it is still referenced in any database of the cluster; an error\nwill be raised if so. Before dropping the role, you must drop all the objects it owns (or\nreassign their ownership) and revoke any privileges the role has been granted on other\nobjects. The REASSIGN OWNED and DROP OWNED commands can be useful for this purpose; see\nSection 22.4 for more discussion.\n\nHowever, it is not necessary to remove role memberships involving the role; DROP ROLE\nautomatically revokes any memberships of the target role in other roles, and of other roles\nin the target role. The other roles are not dropped nor otherwise affected.\n",
            "subsections": []
        },
        "PARAMETERS": {
            "content": "IF EXISTS\nDo not throw an error if the role does not exist. A notice is issued in this case.\n\nname\nThe name of the role to remove.\n",
            "subsections": []
        },
        "NOTES": {
            "content": "PostgreSQL includes a program dropuser(1) that has the same functionality as this command (in\nfact, it calls this command) but can be run from the command shell.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "To drop a role:\n\nDROP ROLE jonathan;\n",
            "subsections": []
        },
        "COMPATIBILITY": {
            "content": "The SQL standard defines DROP ROLE, but it allows only one role to be dropped at a time, and\nit specifies different privilege requirements than PostgreSQL uses.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "CREATE ROLE (CREATEROLE(7)), ALTER ROLE (ALTERROLE(7)), SET ROLE (SETROLE(7))\n\nPostgreSQL 16.14                                2026                                    DROP ROLE(7)",
            "subsections": []
        }
    },
    "summary": "DROPROLE - remove a database role",
    "flags": [],
    "examples": [
        "To drop a role:",
        "DROP ROLE jonathan;"
    ],
    "see_also": [
        {
            "name": "CREATEROLE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/CREATEROLE/7/json"
        },
        {
            "name": "ALTERROLE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/ALTERROLE/7/json"
        },
        {
            "name": "SETROLE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/SETROLE/7/json"
        },
        {
            "name": "ROLE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/ROLE/7/json"
        }
    ],
    "tldr": {
        "source": "not_found",
        "examples": []
    }
}