3 PostgreSQL documentation
6 <refentry id=
"SQL-REASSIGN-OWNED">
8 <refentrytitle id=
"SQL-REASSIGN-OWNED-TITLE">REASSIGN OWNED
</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
14 <refname>REASSIGN OWNED
</refname>
15 <refpurpose>change the ownership of database objects owned by a database role
</refpurpose>
18 <indexterm zone=
"sql-reassign-owned">
19 <primary>REASSIGN OWNED
</primary>
24 REASSIGN OWNED BY
<replaceable class=
"PARAMETER">old_role
</replaceable> [, ...] TO
<replaceable class=
"PARAMETER">new_role
</replaceable>
29 <title>Description
</title>
32 <command>REASSIGN OWNED
</command> instructs the system to change
33 the ownership of the database objects owned by one of the
34 old_roles, to new_role.
39 <title>Parameters
</title>
43 <term><replaceable class=
"PARAMETER">old_role
</replaceable></term>
46 The name of a role. The ownership of all the objects in the
47 current database owned by this role will be reassigned to
48 <replaceable class=
"PARAMETER">new_role
</replaceable>.
54 <term><replaceable class=
"PARAMETER">new_role
</replaceable></term>
57 The name of the role that will be made the new owner of the
69 <command>REASSIGN OWNED
</command> is often used to prepare for the
70 removal of one or more roles. Because
<command>REASSIGN
71 OWNED
</command> only affects the objects in the current database,
72 it is usually necessary to execute this command in each database
73 that contains objects owned by a role that is to be removed.
77 The
<xref linkend=
"sql-drop-owned"
78 endterm=
"sql-drop-owned-title"> command is an alternative that
79 drops all the database objects owned by one or more roles.
83 The
<command>REASSIGN OWNED
</command> command does not affect the
84 privileges granted to the old_roles in objects that are not owned
85 by them. Use
<command>DROP OWNED
</command> to revoke those
92 <title>Compatibility
</title>
95 The
<command>REASSIGN OWNED
</command> statement is a
96 <productname>PostgreSQL
</productname> extension.
101 <title>See Also
</title>
103 <simplelist type=
"inline">
104 <member><xref linkend=
"sql-drop-owned" endterm=
"sql-drop-owned-title"></member>
105 <member><xref linkend=
"sql-droprole" endterm=
"sql-droprole-title"></member>