{
    "mode": "man",
    "parameter": "REASSIGN_OWNED",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/REASSIGN_OWNED/7/json",
    "generated": "2026-05-30T05:15:22Z",
    "synopsis": "REASSIGN OWNED BY { oldrole | CURRENTROLE | CURRENTUSER | SESSIONUSER } [, ...]\nTO { newrole | CURRENTROLE | CURRENTUSER | SESSIONUSER }",
    "sections": {
        "NAME": {
            "content": "REASSIGNOWNED - change the ownership of database objects owned by a database role\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "REASSIGN OWNED BY { oldrole | CURRENTROLE | CURRENTUSER | SESSIONUSER } [, ...]\nTO { newrole | CURRENTROLE | CURRENTUSER | SESSIONUSER }\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "REASSIGN OWNED instructs the system to change the ownership of database objects owned by any\nof the oldroles to newrole.\n",
            "subsections": []
        },
        "PARAMETERS": {
            "content": "oldrole\nThe name of a role. The ownership of all the objects within the current database, and of\nall shared objects (databases, tablespaces), owned by this role will be reassigned to\nnewrole.\n\nnewrole\nThe name of the role that will be made the new owner of the affected objects.\n",
            "subsections": []
        },
        "NOTES": {
            "content": "REASSIGN OWNED is often used to prepare for the removal of one or more roles. Because\nREASSIGN OWNED does not affect objects within other databases, it is usually necessary to\nexecute this command in each database that contains objects owned by a role that is to be\nremoved.\n\nREASSIGN OWNED requires membership on both the source role(s) and the target role.\n\nThe DROP OWNED command is an alternative that simply drops all the database objects owned by\none or more roles.\n\nThe REASSIGN OWNED command does not affect any privileges granted to the oldroles on objects\nthat are not owned by them. Likewise, it does not affect default privileges created with\nALTER DEFAULT PRIVILEGES. Use DROP OWNED to revoke such privileges.\n\nSee Section 22.4 for more discussion.\n",
            "subsections": []
        },
        "COMPATIBILITY": {
            "content": "The REASSIGN OWNED command is a PostgreSQL extension.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "DROP OWNED (DROPOWNED(7)), DROP ROLE (DROPROLE(7)), ALTER DATABASE (ALTERDATABASE(7))\n\n\n\nPostgreSQL 14.23                                2026                               REASSIGN OWNED(7)",
            "subsections": []
        }
    },
    "summary": "REASSIGNOWNED - change the ownership of database objects owned by a database role",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "DROPOWNED",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/DROPOWNED/7/json"
        },
        {
            "name": "DROPROLE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/DROPROLE/7/json"
        },
        {
            "name": "ALTERDATABASE",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/ALTERDATABASE/7/json"
        },
        {
            "name": "OWNED",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/OWNED/7/json"
        }
    ]
}