| 1 |
<!-- |
| 2 |
doc/src/sgml/ref/drop_extension.sgml |
| 3 |
PostgreSQL documentation |
| 4 |
--> |
| 5 |
|
| 6 |
<refentry id="sql-dropextension"> |
| 7 |
<indexterm zone="sql-dropextension"> |
| 8 |
<primary>DROP EXTENSION</primary> |
| 9 |
</indexterm> |
| 10 |
|
| 11 |
<refmeta> |
| 12 |
<refentrytitle>DROP EXTENSION</refentrytitle> |
| 13 |
<manvolnum>7</manvolnum> |
| 14 |
<refmiscinfo>SQL - Language Statements</refmiscinfo> |
| 15 |
</refmeta> |
| 16 |
|
| 17 |
<refnamediv> |
| 18 |
<refname>DROP EXTENSION</refname> |
| 19 |
<refpurpose>remove an extension</refpurpose> |
| 20 |
</refnamediv> |
| 21 |
|
| 22 |
<refsynopsisdiv> |
| 23 |
<synopsis> |
| 24 |
DROP EXTENSION [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [, ...] [ CASCADE | RESTRICT ] |
| 25 |
</synopsis> |
| 26 |
</refsynopsisdiv> |
| 27 |
|
| 28 |
<refsect1> |
| 29 |
<title>Description</title> |
| 30 |
|
| 31 |
<para> |
| 32 |
<command>DROP EXTENSION</command> removes extensions from the database. |
| 33 |
Dropping an extension causes its member objects, and other explicitly |
| 34 |
dependent routines (see <xref linkend="sql-alterroutine"/>, |
| 35 |
the <literal>DEPENDS ON EXTENSION <replaceable>extension_name</replaceable> |
| 36 |
</literal> action), to be dropped as well. |
| 37 |
</para> |
| 38 |
|
| 39 |
<para> |
| 40 |
You must own the extension to use <command>DROP EXTENSION</command>. |
| 41 |
</para> |
| 42 |
</refsect1> |
| 43 |
|
| 44 |
<refsect1> |
| 45 |
<title>Parameters</title> |
| 46 |
|
| 47 |
<variablelist> |
| 48 |
|
| 49 |
<varlistentry> |
| 50 |
<term><literal>IF EXISTS</literal></term> |
| 51 |
<listitem> |
| 52 |
<para> |
| 53 |
Do not throw an error if the extension does not exist. A notice is issued |
| 54 |
in this case. |
| 55 |
</para> |
| 56 |
</listitem> |
| 57 |
</varlistentry> |
| 58 |
|
| 59 |
<varlistentry> |
| 60 |
<term><replaceable class="parameter">name</replaceable></term> |
| 61 |
<listitem> |
| 62 |
<para> |
| 63 |
The name of an installed extension. |
| 64 |
</para> |
| 65 |
</listitem> |
| 66 |
</varlistentry> |
| 67 |
|
| 68 |
<varlistentry> |
| 69 |
<term><literal>CASCADE</literal></term> |
| 70 |
<listitem> |
| 71 |
<para> |
| 72 |
Automatically drop objects that depend on the extension, |
| 73 |
and in turn all objects that depend on those objects |
| 74 |
(see <xref linkend="ddl-depend"/>). |
| 75 |
</para> |
| 76 |
</listitem> |
| 77 |
</varlistentry> |
| 78 |
|
| 79 |
<varlistentry> |
| 80 |
<term><literal>RESTRICT</literal></term> |
| 81 |
<listitem> |
| 82 |
<para> |
| 83 |
This option prevents the specified extensions from being dropped if |
| 84 |
other objects, besides these extensions, their members, and their |
| 85 |
explicitly dependent routines, depend on them. This is the default. |
| 86 |
</para> |
| 87 |
</listitem> |
| 88 |
</varlistentry> |
| 89 |
</variablelist> |
| 90 |
</refsect1> |
| 91 |
|
| 92 |
<refsect1> |
| 93 |
<title>Examples</title> |
| 94 |
|
| 95 |
<para> |
| 96 |
To remove the extension <literal>hstore</literal> from the current |
| 97 |
database: |
| 98 |
<programlisting> |
| 99 |
DROP EXTENSION hstore; |
| 100 |
</programlisting> |
| 101 |
This command will fail if any of <literal>hstore</literal>'s objects |
| 102 |
are in use in the database, for example if any tables have columns |
| 103 |
of the <type>hstore</type> type. Add the <literal>CASCADE</literal> option to |
| 104 |
forcibly remove those dependent objects as well. |
| 105 |
</para> |
| 106 |
</refsect1> |
| 107 |
|
| 108 |
<refsect1> |
| 109 |
<title>Compatibility</title> |
| 110 |
|
| 111 |
<para> |
| 112 |
<command>DROP EXTENSION</command> is a <productname>PostgreSQL</productname> |
| 113 |
extension. |
| 114 |
</para> |
| 115 |
</refsect1> |
| 116 |
|
| 117 |
<refsect1> |
| 118 |
<title>See Also</title> |
| 119 |
|
| 120 |
<simplelist type="inline"> |
| 121 |
<member><xref linkend="sql-createextension"/></member> |
| 122 |
<member><xref linkend="sql-alterextension"/></member> |
| 123 |
</simplelist> |
| 124 |
</refsect1> |
| 125 |
|
| 126 |
</refentry> |