mirror of
https://github.com/postgres/postgres.git
synced 2025-12-18 05:01:01 +03:00
Improve documentation of the role-dropping process.
In general one may have to run both REASSIGN OWNED and DROP OWNED to get rid of all the dependencies of a role to be dropped. This was alluded to in the REASSIGN OWNED man page, but not really spelled out in full; and in any case the procedure ought to be documented in a more prominent place than that. Add a section to the "Database Roles" chapter explaining this, and do a bit of wordsmithing in the relevant commands' man pages.
This commit is contained in:
@@ -90,19 +90,24 @@ DROP OWNED BY { <replaceable class="PARAMETER">name</replaceable> | CURRENT_USER
|
||||
<para>
|
||||
The <xref linkend="sql-reassign-owned"> command is an alternative that
|
||||
reassigns the ownership of all the database objects owned by one or
|
||||
more roles.
|
||||
more roles. However, <command>REASSIGN OWNED</> does not deal with
|
||||
privileges for other objects.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Databases and tablespaces owned by the role(s) will not be removed.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
See <xref linkend="role-removal"> for more discussion.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Compatibility</title>
|
||||
|
||||
<para>
|
||||
The <command>DROP OWNED</command> statement is a
|
||||
The <command>DROP OWNED</command> command is a
|
||||
<productname>PostgreSQL</productname> extension.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
@@ -39,10 +39,10 @@ DROP ROLE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, ...
|
||||
A role cannot be removed if it is still referenced in any database
|
||||
of the cluster; an error will be raised if so. Before dropping the role,
|
||||
you must drop all the objects it owns (or reassign their ownership)
|
||||
and revoke any privileges the role has been granted. The <xref
|
||||
linkend="sql-reassign-owned">
|
||||
and <xref linkend="sql-drop-owned">
|
||||
commands can be useful for this purpose.
|
||||
and revoke any privileges the role has been granted on other objects.
|
||||
The <xref linkend="sql-reassign-owned"> and <xref linkend="sql-drop-owned">
|
||||
commands can be useful for this purpose; see <xref linkend="role-removal">
|
||||
for more discussion.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
||||
@@ -29,7 +29,7 @@ DROP USER [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, ...
|
||||
<title>Description</title>
|
||||
|
||||
<para>
|
||||
<command>DROP USER</command> is now an alias for
|
||||
<command>DROP USER</command> is simply an alternate spelling of
|
||||
<xref linkend="sql-droprole">.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
@@ -31,8 +31,9 @@ REASSIGN OWNED BY { <replaceable class="PARAMETER">old_role</replaceable> | CURR
|
||||
|
||||
<para>
|
||||
<command>REASSIGN OWNED</command> instructs the system to change
|
||||
the ownership of database objects owned by one of the
|
||||
old_roles, to new_role.
|
||||
the ownership of database objects owned by any of the
|
||||
<replaceable class="PARAMETER">old_roles</replaceable> to
|
||||
<replaceable class="PARAMETER">new_role</replaceable>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
@@ -82,16 +83,18 @@ REASSIGN OWNED BY { <replaceable class="PARAMETER">old_role</replaceable> | CURR
|
||||
|
||||
<para>
|
||||
The <xref linkend="sql-drop-owned"> command is an alternative that
|
||||
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).
|
||||
simply drops all the database objects owned by one or more roles.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
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.
|
||||
The <command>REASSIGN OWNED</command> command does not affect any
|
||||
privileges granted to the <replaceable class="PARAMETER">old_roles</> for
|
||||
objects that are not owned by them. Use <command>DROP OWNED</command> to
|
||||
revoke such privileges.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
See <xref linkend="role-removal"> for more discussion.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
@@ -100,7 +103,7 @@ REASSIGN OWNED BY { <replaceable class="PARAMETER">old_role</replaceable> | CURR
|
||||
<title>Compatibility</title>
|
||||
|
||||
<para>
|
||||
The <command>REASSIGN OWNED</command> statement is a
|
||||
The <command>REASSIGN OWNED</command> command is a
|
||||
<productname>PostgreSQL</productname> extension.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
Reference in New Issue
Block a user