4 REASSIGN OWNED — change the ownership of database objects owned by a
9 REASSIGN OWNED BY { old_role | CURRENT_ROLE | CURRENT_USER | SESSION_USER } [, .
11 TO { new_role | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
15 REASSIGN OWNED instructs the system to change the ownership of database
16 objects owned by any of the old_roles to new_role.
21 The name of a role. The ownership of all the objects within the
22 current database, and of all shared objects (databases,
23 tablespaces), owned by this role will be reassigned to new_role.
26 The name of the role that will be made the new owner of the
31 REASSIGN OWNED is often used to prepare for the removal of one or more
32 roles. Because REASSIGN OWNED does not affect objects within other
33 databases, it is usually necessary to execute this command in each
34 database that contains objects owned by a role that is to be removed.
36 REASSIGN OWNED requires membership on both the source role(s) and the
39 The DROP OWNED command is an alternative that simply drops all the
40 database objects owned by one or more roles.
42 The REASSIGN OWNED command does not affect any privileges granted to
43 the old_roles on objects that are not owned by them. Likewise, it does
44 not affect default privileges created with ALTER DEFAULT PRIVILEGES.
45 Use DROP OWNED to revoke such privileges.
47 See Section 21.4 for more discussion.
51 The REASSIGN OWNED command is a PostgreSQL extension.
55 DROP OWNED, DROP ROLE, ALTER DATABASE