Add more explicit note that the parameters of MOVE are identical to FETCH.
[PostgreSQL.git] / doc / src / sgml / ref / reassign_owned.sgml
blob699c1e8fad17e432d253683e8887660f8e6b104e
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-REASSIGN-OWNED">
7 <refmeta>
8 <refentrytitle id="SQL-REASSIGN-OWNED-TITLE">REASSIGN OWNED</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>REASSIGN OWNED</refname>
15 <refpurpose>change the ownership of database objects owned by a database role</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-reassign-owned">
19 <primary>REASSIGN OWNED</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
24 REASSIGN OWNED BY <replaceable class="PARAMETER">old_role</replaceable> [, ...] TO <replaceable class="PARAMETER">new_role</replaceable>
25 </synopsis>
26 </refsynopsisdiv>
28 <refsect1>
29 <title>Description</title>
31 <para>
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.
35 </para>
36 </refsect1>
38 <refsect1>
39 <title>Parameters</title>
41 <variablelist>
42 <varlistentry>
43 <term><replaceable class="PARAMETER">old_role</replaceable></term>
44 <listitem>
45 <para>
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>.
49 </para>
50 </listitem>
51 </varlistentry>
53 <varlistentry>
54 <term><replaceable class="PARAMETER">new_role</replaceable></term>
55 <listitem>
56 <para>
57 The name of the role that will be made the new owner of the
58 affected objects.
59 </para>
60 </listitem>
61 </varlistentry>
62 </variablelist>
63 </refsect1>
65 <refsect1>
66 <title>Notes</title>
68 <para>
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.
74 </para>
76 <para>
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.
80 </para>
82 <para>
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
86 privileges.
87 </para>
89 </refsect1>
91 <refsect1>
92 <title>Compatibility</title>
94 <para>
95 The <command>REASSIGN OWNED</command> statement is a
96 <productname>PostgreSQL</productname> extension.
97 </para>
98 </refsect1>
100 <refsect1>
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>
106 </simplelist>
107 </refsect1>
109 </refentry>