All Products
Search
Document Center

PolarDB:REASSIGN OWNED

Last Updated:Mar 28, 2026

REASSIGN OWNED transfers ownership of all database objects owned by one or more source roles to a target role.

Synopsis

REASSIGN OWNED BY { old_role | CURRENT_USER | SESSION_USER } [, ...]
               TO { new_role | CURRENT_USER | SESSION_USER }

Parameters

ParameterDescription
old_roleThe source role. All objects within the current database, and all shared objects (databases and tablespaces), owned by this role are reassigned to new_role.
new_roleThe target role that becomes the new owner of the affected objects.

Usage notes

  • REASSIGN OWNED only affects objects in the current database. Because it does not affect objects within other databases, it is usually necessary to run it in each database that contains objects owned by the role you intend to remove.

  • Membership in both the source role(s) and the target role is required to run this command.

  • DROP OWNED is an alternative that simply drops all the database objects owned by one or more roles.

  • REASSIGN OWNED does not affect privileges granted to old_role on objects it does not own, nor does it affect default privileges configured with ALTER DEFAULT PRIVILEGES. Run DROP OWNED to revoke those privileges.

See also

  • DROP OWNED

  • DROP ROLE

  • ALTER DEFAULT PRIVILEGES