2 $PostgreSQL: pgsql/doc/src/sgml/ref/drop_table.sgml,v 1.21 2003/11/29 19:51:38 pgsql Exp $
3 PostgreSQL documentation
6 <refentry id="SQL-DROPTABLE">
8 <refentrytitle id="SQL-DROPTABLE-TITLE">DROP TABLE</refentrytitle>
9 <refmiscinfo>SQL - Language Statements</refmiscinfo>
13 <refname>DROP TABLE</refname>
14 <refpurpose>remove a table</refpurpose>
17 <indexterm zone="sql-droptable">
18 <primary>DROP TABLE</primary>
23 DROP TABLE <replaceable class="PARAMETER">name</replaceable> [, ...] [ CASCADE | RESTRICT ]
28 <title>Description</title>
31 <command>DROP TABLE</command> removes tables from the database.
32 Only its owner may destroy a table. To empty a table of rows,
33 without destroying the table, use <command>DELETE</command>.
37 <command>DROP TABLE</command> always removes any indexes, rules,
38 triggers, and constraints that exist for the target table.
39 However, to drop a table that is referenced by a foreign-key
40 constraint of another table, <literal>CASCADE</> must be
41 specified. (<literal>CASCADE</> will remove the foreign-key
42 constraint, not the other table entirely.)
47 <title>Parameters</title>
51 <term><replaceable class="PARAMETER">name</replaceable></term>
54 The name (optionally schema-qualified) of the table to drop.
60 <term><literal>CASCADE</literal></term>
63 Automatically drop objects that depend on the table (such as
70 <term><literal>RESTRICT</literal></term>
73 Refuse to drop the table if any objects depend on it. This is
82 <title>Examples</title>
85 To destroy two tables, <literal>films</literal> and
86 <literal>distributors</literal>:
89 DROP TABLE films, distributors;
95 <title>Compatibility</title>
98 This command conforms to the SQL standard.
103 <title>See Also</title>
105 <simplelist type="inline">
106 <member><xref linkend="sql-altertable" endterm="sql-altertable-title"></member>
107 <member><xref linkend="sql-createtable" endterm="sql-createtable-title"></member>
113 <!-- Keep this comment at the end of the file
118 sgml-minimize-attributes:nil
119 sgml-always-quote-attributes:t
122 sgml-parent-document:nil
123 sgml-default-dtd-file:"../reference.ced"
124 sgml-exposed-tags:nil
125 sgml-local-catalogs:"/usr/lib/sgml/catalog"
126 sgml-local-ecat-files:nil