]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/drop_owned.sgml
Create a "sort support" interface API for faster sorting.
[postgresql] / doc / src / sgml / ref / drop_owned.sgml
1 <!--
2 doc/src/sgml/ref/drop_owned.sgml
3 PostgreSQL documentation
4 -->
5
6 <refentry id="SQL-DROP-OWNED">
7  <refmeta>
8   <refentrytitle>DROP OWNED</refentrytitle>
9   <manvolnum>7</manvolnum>
10   <refmiscinfo>SQL - Language Statements</refmiscinfo>
11  </refmeta>
12
13  <refnamediv>
14   <refname>DROP OWNED</refname>
15   <refpurpose>remove database objects owned by a database role</refpurpose>
16  </refnamediv>
17
18  <indexterm zone="sql-drop-owned">
19   <primary>DROP OWNED</primary>
20  </indexterm>
21
22  <refsynopsisdiv>
23 <synopsis>
24 DROP OWNED BY <replaceable class="PARAMETER">name</replaceable> [, ...] [ CASCADE | RESTRICT ]
25 </synopsis>
26  </refsynopsisdiv>
27
28  <refsect1>
29   <title>Description</title>
30
31   <para>
32    <command>DROP OWNED</command> drops all the objects in the current
33    database that are owned by one of the specified roles. Any
34    privileges granted to the given roles on objects in the current
35    database will also be revoked.
36   </para>
37  </refsect1>
38
39  <refsect1>
40   <title>Parameters</title>
41
42   <variablelist>
43    <varlistentry>
44     <term><replaceable class="PARAMETER">name</replaceable></term>
45     <listitem>
46      <para>
47       The name of a role whose objects will be dropped, and whose
48       privileges will be revoked.
49      </para>
50     </listitem>
51    </varlistentry>
52
53    <varlistentry>
54     <term><literal>CASCADE</literal></term>
55     <listitem>
56      <para>
57       Automatically drop objects that depend on the affected objects.
58      </para>
59     </listitem>
60    </varlistentry>
61
62    <varlistentry>
63     <term><literal>RESTRICT</literal></term>
64     <listitem>
65      <para>
66       Refuse to drop the objects owned by a role if any other database
67       objects depend on one of the affected objects. This is the default.
68      </para>
69     </listitem>
70    </varlistentry>
71   </variablelist>
72  </refsect1>
73
74  <refsect1>
75   <title>Notes</title>
76   <para>
77    <command>DROP OWNED</command> is often used to prepare for the
78    removal of one or more roles. Because <command>DROP OWNED</command>
79    only affects the objects in the current database, it is usually
80    necessary to execute this command in each database that contains
81    objects owned by a role that is to be removed.
82   </para>
83
84   <para>
85    Using the <literal>CASCADE</literal> option might make the command
86    recurse to objects owned by other users.
87   </para>
88
89   <para>
90    The <xref linkend="sql-reassign-owned"> command is an alternative that
91    reassigns the ownership of all the database objects owned by one or
92    more roles.
93   </para>
94
95   <para>
96    Databases owned by the role(s) will not be removed.
97   </para>
98  </refsect1>
99
100  <refsect1>
101   <title>Compatibility</title>
102
103   <para>
104    The <command>DROP OWNED</command> statement is a
105    <productname>PostgreSQL</productname> extension.
106   </para>
107  </refsect1>
108
109  <refsect1>
110   <title>See Also</title>
111
112   <simplelist type="inline">
113    <member><xref linkend="sql-reassign-owned"></member>
114    <member><xref linkend="sql-droprole"></member>
115   </simplelist>
116  </refsect1>
117
118 </refentry>