REASSIGN OWNED

Synopsis

Use the REASSIGN OWNED statement to change the ownership of database objects owned by any of the old_roles to new_role.

Syntax

  1. reassign_owned ::= REASSIGN OWNED BY role_specification [ , ... ] TO
  2. role_specification
  3. role_specification ::= role_name | CURRENT_USER | SESSION_USER

reassign_owned

REASSIGN OWNED - 图1

role_specification

REASSIGN OWNED - 图2

Semantics

REASSIGN OWNED is typically used to prepare for the removal of a role. It requires membership on both the source roles and target role.

Examples

  • Reassign all objects owned by john to yugabyte.
  1. yugabyte=# reassign owned by john to yugabyte;

See also