2 doc/src/sgml/ref/drop_foreign_table.sgml
3 PostgreSQL documentation
6 <refentry id=
"sql-dropforeigntable">
7 <indexterm zone=
"sql-dropforeigntable">
8 <primary>DROP FOREIGN TABLE
</primary>
12 <refentrytitle>DROP FOREIGN TABLE
</refentrytitle>
13 <manvolnum>7</manvolnum>
14 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
18 <refname>DROP FOREIGN TABLE
</refname>
19 <refpurpose>remove a foreign table
</refpurpose>
24 DROP FOREIGN TABLE [ IF EXISTS ]
<replaceable class=
"parameter">name
</replaceable> [, ...] [ CASCADE | RESTRICT ]
29 <title>Description
</title>
32 <command>DROP FOREIGN TABLE
</command> removes a foreign table.
33 Only the owner of a foreign table can remove it.
38 <title>Parameters
</title>
42 <term><literal>IF EXISTS
</literal></term>
45 Do not throw an error if the foreign table does not exist.
46 A notice is issued in this case.
52 <term><replaceable class=
"parameter">name
</replaceable></term>
55 The name (optionally schema-qualified) of the foreign table to drop.
61 <term><literal>CASCADE
</literal></term>
64 Automatically drop objects that depend on the foreign table (such as
65 views), and in turn all objects that depend on those objects
66 (see
<xref linkend=
"ddl-depend"/>).
72 <term><literal>RESTRICT
</literal></term>
75 Refuse to drop the foreign table if any objects depend on it. This is
84 <title>Examples
</title>
87 To destroy two foreign tables,
<literal>films
</literal> and
88 <literal>distributors
</literal>:
91 DROP FOREIGN TABLE films, distributors;
92 </programlisting></para>
96 <title>Compatibility
</title>
99 This command conforms to ISO/IEC
9075-
9 (SQL/MED), except that the
100 standard only allows one foreign table to be dropped per command, and apart
101 from the
<literal>IF EXISTS
</literal> option, which is a
<productname>PostgreSQL
</productname>
107 <title>See Also
</title>
109 <simplelist type=
"inline">
110 <member><xref linkend=
"sql-alterforeigntable"/></member>
111 <member><xref linkend=
"sql-createforeigntable"/></member>