Back to Materialize

REASSIGN OWNED

doc/user/content/sql/reassign-owned.md

123914 B
Original Source

REASSIGN OWNED reassigns the owner of all the objects that are owned by one of the specified roles.

{{< note >}} Unlike PostgreSQL, Materialize reassigns all objects across all databases, including the databases themselves. {{< /note >}}

Syntax

mzsql
REASSIGN OWNED BY <current_owner> [, ...] TO <new_owner>;
Syntax elementDescription
<current_owner>The role whose objects are to be reassigned.
<new_owner>The role name of the new owner of these objects.

Examples

mzsql
REASSIGN OWNED BY joe TO mike;
mzsql
REASSIGN OWNED BY joe, george TO mike;

Privileges

The privileges required to execute this statement are:

{{% include-headless "/headless/sql-command-privileges/reassign-owned" %}}