]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/drop_extension.sgml
Add support for piping COPY to/from an external program.
[postgresql] / doc / src / sgml / ref / drop_extension.sgml
1 <!--
2 doc/src/sgml/ref/drop_extension.sgml
3 PostgreSQL documentation
4 -->
5
6 <refentry id="SQL-DROPEXTENSION">
7  <refmeta>
8   <refentrytitle>DROP EXTENSION</refentrytitle>
9   <manvolnum>7</manvolnum>
10   <refmiscinfo>SQL - Language Statements</refmiscinfo>
11  </refmeta>
12
13  <refnamediv>
14   <refname>DROP EXTENSION</refname>
15   <refpurpose>remove an extension</refpurpose>
16  </refnamediv>
17
18  <indexterm zone="sql-dropextension">
19   <primary>DROP EXTENSION</primary>
20  </indexterm>
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 component objects to be dropped as well.
34   </para>
35
36   <para>
37    You must own the extension to use <command>DROP EXTENSION</command>.
38   </para>
39  </refsect1>
40
41  <refsect1>
42   <title>Parameters</title>
43
44   <variablelist>
45
46    <varlistentry>
47     <term><literal>IF EXISTS</literal></term>
48     <listitem>
49      <para>
50       Do not throw an error if the extension does not exist. A notice is issued
51       in this case.
52      </para>
53     </listitem>
54    </varlistentry>
55
56    <varlistentry>
57     <term><replaceable class="PARAMETER">name</replaceable></term>
58     <listitem>
59      <para>
60       The name of an installed extension.
61      </para>
62     </listitem>
63    </varlistentry>
64
65    <varlistentry>
66     <term><literal>CASCADE</literal></term>
67     <listitem>
68      <para>
69       Automatically drop objects that depend on the extension.
70      </para>
71     </listitem>
72    </varlistentry>
73
74    <varlistentry>
75     <term><literal>RESTRICT</literal></term>
76     <listitem>
77      <para>
78       Refuse to drop the extension if any objects depend on it (other than
79       its own member objects and other extensions listed in the same
80       <command>DROP</> command).  This is the default.
81      </para>
82     </listitem>
83    </varlistentry>
84   </variablelist>
85  </refsect1>
86
87  <refsect1>
88   <title>Examples</title>
89
90   <para>
91    To remove the extension <literal>hstore</literal> from the current
92    database:
93 <programlisting>
94 DROP EXTENSION hstore;
95 </programlisting>
96    This command will fail if any of <literal>hstore</literal>'s objects
97    are in use in the database, for example if any tables have columns
98    of the <type>hstore</> type.  Add the <literal>CASCADE</> option to
99    forcibly remove those dependent objects as well.
100   </para>
101  </refsect1>
102
103  <refsect1>
104   <title>Compatibility</title>
105
106   <para>
107    <command>DROP EXTENSION</command> is a <productname>PostgreSQL</>
108    extension.
109   </para>
110  </refsect1>
111
112  <refsect1>
113   <title>See Also</title>
114
115   <simplelist type="inline">
116    <member><xref linkend="sql-createextension"></member>
117    <member><xref linkend="sql-alterextension"></member>
118   </simplelist>
119  </refsect1>
120
121 </refentry>