1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-22 17:42:17 +03:00
Files
postgres/doc/src/sgml/ref/drop_role.sgml
Peter Eisentraut 6ef2448796 Fix a whitespace issue with the man pages
There is what may actually be a mistake in our markup.  The problem is
in a situation like

<para>
 <command>FOO</command> is ...

there is strictly speaking a line break before "FOO".  In the HTML
output, this does not appear to be a problem, but in the man page
output, this shows up, so you get double blank lines at odd places.

So far, we have attempted to work around this with an XSL hack, but
that causes other problems, such as creating run-ins in places like

<acronym>SQL</acronym> <command>COPY</command>

So fix the problem properly by removing the extra whitespace.  I only
fixed the problems that affect the man page output, not all the
places.
2011-08-07 10:55:32 +03:00

123 lines
3.0 KiB
Plaintext

<!--
doc/src/sgml/ref/drop_role.sgml
PostgreSQL documentation
-->
<refentry id="SQL-DROPROLE">
<refmeta>
<refentrytitle>DROP ROLE</refentrytitle>
<manvolnum>7</manvolnum>
<refmiscinfo>SQL - Language Statements</refmiscinfo>
</refmeta>
<refnamediv>
<refname>DROP ROLE</refname>
<refpurpose>remove a database role</refpurpose>
</refnamediv>
<indexterm zone="sql-droprole">
<primary>DROP ROLE</primary>
</indexterm>
<refsynopsisdiv>
<synopsis>
DROP ROLE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, ...]
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
<command>DROP ROLE</command> removes the specified role(s).
To drop a superuser role, you must be a superuser yourself;
to drop non-superuser roles, you must have <literal>CREATEROLE</>
privilege.
</para>
<para>
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.
</para>
<para>
However, it is not necessary to remove role memberships involving
the role; <command>DROP ROLE</> automatically revokes any memberships
of the target role in other roles, and of other roles in the target role.
The other roles are not dropped nor otherwise affected.
</para>
</refsect1>
<refsect1>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term><literal>IF EXISTS</literal></term>
<listitem>
<para>
Do not throw an error if the role does not exist. A notice is issued
in this case.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="PARAMETER">name</replaceable></term>
<listitem>
<para>
The name of the role to remove.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Notes</title>
<para>
<productname>PostgreSQL</productname> includes a program <xref
linkend="APP-DROPUSER"> that has the
same functionality as this command (in fact, it calls this command)
but can be run from the command shell.
</para>
</refsect1>
<refsect1>
<title>Examples</title>
<para>
To drop a role:
<programlisting>
DROP ROLE jonathan;
</programlisting></para>
</refsect1>
<refsect1>
<title>Compatibility</title>
<para>
The SQL standard defines <command>DROP ROLE</command>, but it allows
only one role to be dropped at a time, and it specifies different
privilege requirements than <productname>PostgreSQL</productname> uses.
</para>
</refsect1>
<refsect1>
<title>See Also</title>
<simplelist type="inline">
<member><xref linkend="sql-createrole"></member>
<member><xref linkend="sql-alterrole"></member>
<member><xref linkend="sql-set-role"></member>
</simplelist>
</refsect1>
</refentry>