]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/drop_foreign_table.sgml
Add support for piping COPY to/from an external program.
[postgresql] / doc / src / sgml / ref / drop_foreign_table.sgml
1 <!-- doc/src/sggml/ref/drop_foreign_table.sgml -->
2
3 <refentry id="SQL-DROPFOREIGNTABLE">
4  <refmeta>
5   <refentrytitle>DROP FOREIGN TABLE</refentrytitle>
6   <manvolnum>7</manvolnum>
7   <refmiscinfo>SQL - Language Statements</refmiscinfo>
8  </refmeta>
9
10  <refnamediv>
11   <refname>DROP FOREIGN TABLE</refname>
12   <refpurpose>remove a foreign table</refpurpose>
13  </refnamediv>
14
15  <indexterm zone="sql-dropforeigntable">
16   <primary>DROP FOREIGN TABLE</primary>
17  </indexterm>
18
19  <refsynopsisdiv>
20 <synopsis>
21 DROP FOREIGN TABLE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, ...] [ CASCADE | RESTRICT ]
22 </synopsis>
23  </refsynopsisdiv>
24
25  <refsect1>
26   <title>Description</title>
27
28   <para>
29    <command>DROP FOREIGN TABLE</command> removes a foreign table.
30    Only the owner of a foreign table can remove it.
31   </para>
32  </refsect1>
33
34  <refsect1>
35   <title>Parameters</title>
36
37   <variablelist>
38    <varlistentry>
39     <term><literal>IF EXISTS</literal></term>
40     <listitem>
41      <para>
42       Do not throw an error if the foreign table does not exist.
43       A notice is issued in this case.
44      </para>
45     </listitem>
46    </varlistentry>
47
48    <varlistentry>
49     <term><replaceable class="PARAMETER">name</replaceable></term>
50     <listitem>
51      <para>
52       The name (optionally schema-qualified) of the foreign table to drop.
53      </para>
54     </listitem>
55    </varlistentry>
56
57    <varlistentry>
58     <term><literal>CASCADE</literal></term>
59     <listitem>
60      <para>
61       Automatically drop objects that depend on the foreign table (such as
62       views).
63      </para>
64     </listitem>
65    </varlistentry>
66
67    <varlistentry>
68     <term><literal>RESTRICT</literal></term>
69     <listitem>
70      <para>
71       Refuse to drop the foreign table if any objects depend on it.  This is
72       the default.
73      </para>
74     </listitem>
75    </varlistentry>
76   </variablelist>
77  </refsect1>
78
79  <refsect1>
80   <title>Examples</title>
81
82   <para>
83    To destroy two foreign tables, <literal>films</literal> and
84    <literal>distributors</literal>:
85
86 <programlisting>
87 DROP FOREIGN TABLE films, distributors;
88 </programlisting></para>
89  </refsect1>
90
91  <refsect1>
92   <title>Compatibility</title>
93
94   <para>
95    This command conforms to the ISO/IEC 9075-9 (SQL/MED), except that the
96    standard only allows one foreign table to be dropped per command, and apart
97    from the <literal>IF EXISTS</> option, which is a <productname>PostgreSQL</>
98    extension.
99   </para>
100  </refsect1>
101
102  <refsect1>
103   <title>See Also</title>
104
105   <simplelist type="inline">
106    <member><xref linkend="sql-alterforeigntable"></member>
107    <member><xref linkend="sql-createforeigntable"></member>
108   </simplelist>
109  </refsect1>
110
111 </refentry>