3 PostgreSQL documentation
6 <refentry id=
"SQL-DROP-OWNED">
8 <refentrytitle id=
"SQL-DROP-OWNED-TITLE">DROP OWNED
</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
14 <refname>DROP OWNED
</refname>
15 <refpurpose>remove database objects owned by a database role
</refpurpose>
18 <indexterm zone=
"sql-drop-owned">
19 <primary>DROP OWNED
</primary>
24 DROP OWNED BY
<replaceable class=
"PARAMETER">name
</replaceable> [, ...] [ CASCADE | RESTRICT ]
29 <title>Description
</title>
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.
40 <title>Parameters
</title>
44 <term><replaceable class=
"PARAMETER">name
</replaceable></term>
47 The name of a role whose objects will be dropped, and whose
48 privileges will be revoked.
54 <term><literal>CASCADE
</literal></term>
57 Automatically drop objects that depend on the affected objects.
63 <term><literal>RESTRICT
</literal></term>
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.
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.
85 Using the
<literal>CASCADE
</literal> option might make the command
86 recurse to objects owned by other users.
90 The
<xref linkend=
"sql-reassign-owned"
91 endterm=
"sql-reassign-owned-title"> command is an alternative that
92 reassigns the ownership of all the database objects owned by one or
98 <title>Compatibility
</title>
101 The
<command>DROP OWNED
</command> statement is a
102 <productname>PostgreSQL
</productname> extension.
107 <title>See Also
</title>
109 <simplelist type=
"inline">
110 <member><xref linkend=
"sql-reassign-owned" endterm=
"sql-reassign-owned-title"></member>
111 <member><xref linkend=
"sql-droprole" endterm=
"sql-droprole-title"></member>