{
    "mode": "man",
    "parameter": "DROP_USER_MAPPING",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/DROP_USER_MAPPING/7/json",
    "generated": "2026-07-05T11:54:08Z",
    "synopsis": "DROP USER MAPPING [ IF EXISTS ] FOR { username | USER | CURRENTROLE | CURRENTUSER | PUBLIC } SERVER servername",
    "sections": {
        "NAME": {
            "content": "DROPUSERMAPPING - remove a user mapping for a foreign server\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "DROP USER MAPPING [ IF EXISTS ] FOR { username | USER | CURRENTROLE | CURRENTUSER | PUBLIC } SERVER servername\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "DROP USER MAPPING removes an existing user mapping from foreign server.\n\nThe owner of a foreign server can drop user mappings for that server for any user. Also, a\nuser can drop a user mapping for their own user name if USAGE privilege on the server has\nbeen granted to the user.\n",
            "subsections": []
        },
        "PARAMETERS": {
            "content": "IF EXISTS\nDo not throw an error if the user mapping does not exist. A notice is issued in this\ncase.\n\nusername\nUser name of the mapping.  CURRENTROLE, CURRENTUSER, and USER match the name of the\ncurrent user.  PUBLIC is used to match all present and future user names in the system.\n\nservername\nServer name of the user mapping.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "Drop a user mapping bob, server foo if it exists:\n\nDROP USER MAPPING IF EXISTS FOR bob SERVER foo;\n",
            "subsections": []
        },
        "COMPATIBILITY": {
            "content": "DROP USER MAPPING conforms to ISO/IEC 9075-9 (SQL/MED). The IF EXISTS clause is a PostgreSQL\nextension.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "CREATE USER MAPPING (CREATEUSERMAPPING(7)), ALTER USER MAPPING (ALTERUSERMAPPING(7))\n\n\n\nPostgreSQL 14.23                                2026                            DROP USER MAPPING(7)",
            "subsections": []
        }
    },
    "summary": "DROPUSERMAPPING - remove a user mapping for a foreign server",
    "flags": [],
    "examples": [
        "Drop a user mapping bob, server foo if it exists:",
        "DROP USER MAPPING IF EXISTS FOR bob SERVER foo;"
    ],
    "see_also": [
        {
            "name": "CREATEUSERMAPPING",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/CREATEUSERMAPPING/7/json"
        },
        {
            "name": "ALTERUSERMAPPING",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/ALTERUSERMAPPING/7/json"
        },
        {
            "name": "MAPPING",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/MAPPING/7/json"
        }
    ]
}