<para>
<command>REASSIGN OWNED</command> instructs the system to change
- the ownership of the database objects owned by one of the
+ the ownership of database objects owned by one of the
old_roles, to new_role.
</para>
</refsect1>
<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
+ The name of a role. The ownership of all the objects within the
+ current database, and of all shared objects (databases, tablespaces),
+ owned by this role will be reassigned to
<replaceable class="PARAMETER">new_role</replaceable>.
</para>
</listitem>
<para>
<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,
+ OWNED</command> does not affect objects within other databases,
it is usually necessary to execute this command in each database
that contains objects owned by a role that is to be removed.
</para>
privileges.
</para>
- <para>
- The <command>REASSIGN OWNED</command> command does not affect the
- ownership of any databases owned by the role. Use
- <xref linkend="sql-alterdatabase"> to reassign that ownership.
- </para>
-
</refsect1>
<refsect1>
{
Form_pg_shdepend sdepForm = (Form_pg_shdepend) GETSTRUCT(tuple);
- /* We only operate on objects in the current database */
- if (sdepForm->dbid != MyDatabaseId)
+ /*
+ * We only operate on shared objects and objects in the current
+ * database
+ */
+ if (sdepForm->dbid != MyDatabaseId &&
+ sdepForm->dbid != InvalidOid)
continue;
/* Unexpected because we checked for pins above */
case OperatorFamilyRelationId:
case OperatorClassRelationId:
case ExtensionRelationId:
+ case TableSpaceRelationId:
+ case DatabaseRelationId:
{
Oid classId = sdepForm->classid;
Relation catalog;