---
title: "REASSIGN OWNED"
url: "https://docs.yugabyte.com/stable/api/ysql/the-sql-language/statements/dcl_reassign_owned/"
---

# REASSIGN OWNED

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

## Synopsis

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

## Syntax

- [![Grammar Icon](/icons/file-lines.svg)Grammar](#grammar-1)
- [![Diagram Icon](/icons/diagram.svg)Diagram](#diagram-1)

```output.ebnf
reassign_owned ::= REASSIGN OWNED BY role_specification [ , ... ] TO 
                   role_specification

role_specification ::= role_name | CURRENT_USER | SESSION_USER
```

#### reassign\_owned

REASSIGNOWNEDBY,[role\_specification](#role-specification)TO[role\_specification](#role-specification)

#### role\_specification

[role\_name](/stable/api/ysql/syntax_resources/grammar_diagrams#role-name)CURRENT\_USERSESSION\_USER

## 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`.
  
  ```plpgsql
  yugabyte=# reassign owned by john to yugabyte;
  ```

## See also

- [DROP OWNED](/stable/api/ysql/the-sql-language/statements/dcl_drop_owned "DROP OWNED")
- [CREATE ROLE](/stable/api/ysql/the-sql-language/statements/dcl_create_role "CREATE ROLE")
- [GRANT](/stable/api/ysql/the-sql-language/statements/dcl_grant "GRANT")
- [REVOKE](/stable/api/ysql/the-sql-language/statements/dcl_revoke "REVOKE")
