2005-11-21 13:49:33 +01:00
|
|
|
<!--
|
2010-04-02 19:29:22 +02:00
|
|
|
$PostgreSQL: pgsql/doc/src/sgml/ref/reassign_owned.sgml,v 1.5 2010/04/02 17:29:22 sriggs Exp $
|
2005-11-21 13:49:33 +01:00
|
|
|
PostgreSQL documentation
|
|
|
|
-->
|
|
|
|
|
|
|
|
<refentry id="SQL-REASSIGN-OWNED">
|
|
|
|
<refmeta>
|
|
|
|
<refentrytitle id="SQL-REASSIGN-OWNED-TITLE">REASSIGN OWNED</refentrytitle>
|
2008-11-14 11:22:48 +01:00
|
|
|
<manvolnum>7</manvolnum>
|
2005-11-21 13:49:33 +01:00
|
|
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
|
|
|
</refmeta>
|
|
|
|
|
|
|
|
<refnamediv>
|
|
|
|
<refname>REASSIGN OWNED</refname>
|
2006-04-02 06:02:40 +02:00
|
|
|
<refpurpose>change the ownership of database objects owned by a database role</refpurpose>
|
2005-11-21 13:49:33 +01:00
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
<indexterm zone="sql-reassign-owned">
|
|
|
|
<primary>REASSIGN OWNED</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<refsynopsisdiv>
|
|
|
|
<synopsis>
|
2006-04-02 06:02:40 +02:00
|
|
|
REASSIGN OWNED BY <replaceable class="PARAMETER">old_role</replaceable> [, ...] TO <replaceable class="PARAMETER">new_role</replaceable>
|
2005-11-21 13:49:33 +01:00
|
|
|
</synopsis>
|
|
|
|
</refsynopsisdiv>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
|
|
|
|
<para>
|
2006-04-02 06:02:40 +02:00
|
|
|
<command>REASSIGN OWNED</command> instructs the system to change
|
|
|
|
the ownership of the database objects owned by one of the
|
|
|
|
old_roles, to new_role.
|
2005-11-21 13:49:33 +01:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2006-04-02 06:02:40 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>Parameters</title>
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="PARAMETER">old_role</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The name of a role. The ownership of all the objects in the
|
|
|
|
current database owned by this role will be reassigned to
|
|
|
|
<replaceable class="PARAMETER">new_role</replaceable>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><replaceable class="PARAMETER">new_role</replaceable></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The name of the role that will be made the new owner of the
|
|
|
|
affected objects.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</refsect1>
|
|
|
|
|
2005-11-21 13:49:33 +01:00
|
|
|
<refsect1>
|
|
|
|
<title>Notes</title>
|
|
|
|
|
|
|
|
<para>
|
2006-04-02 06:02:40 +02:00
|
|
|
<command>REASSIGN OWNED</command> is often used to prepare for the
|
|
|
|
removal of one or more roles. Because <command>REASSIGN
|
|
|
|
OWNED</command> only affects the objects in the current database,
|
|
|
|
it is usually necessary to execute this command in each database
|
|
|
|
that contains objects owned by a role that is to be removed.
|
|
|
|
</para>
|
|
|
|
|
2010-04-02 19:29:22 +02:00
|
|
|
<para>
|
|
|
|
<command>REASSIGN OWNED</command> requires privileges on both the
|
|
|
|
source role(s) and the target role.
|
|
|
|
</para>
|
|
|
|
|
2006-04-02 06:02:40 +02:00
|
|
|
<para>
|
|
|
|
The <xref linkend="sql-drop-owned"
|
|
|
|
endterm="sql-drop-owned-title"> command is an alternative that
|
2010-04-02 19:29:22 +02:00
|
|
|
drops all the database objects owned by one or more roles. Note
|
|
|
|
also that <command>DROP OWNED</command> requires privileges only
|
|
|
|
on the source role(s).
|
2005-11-21 13:49:33 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2006-04-02 06:02:40 +02:00
|
|
|
The <command>REASSIGN OWNED</command> command does not affect the
|
|
|
|
privileges granted to the old_roles in objects that are not owned
|
|
|
|
by them. Use <command>DROP OWNED</command> to revoke those
|
|
|
|
privileges.
|
2005-11-21 13:49:33 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Compatibility</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <command>REASSIGN OWNED</command> statement is a
|
|
|
|
<productname>PostgreSQL</productname> extension.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>See Also</title>
|
|
|
|
|
|
|
|
<simplelist type="inline">
|
|
|
|
<member><xref linkend="sql-drop-owned" endterm="sql-drop-owned-title"></member>
|
|
|
|
<member><xref linkend="sql-droprole" endterm="sql-droprole-title"></member>
|
|
|
|
</simplelist>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
</refentry>
|