3
.\" Author: The PostgreSQL Global Development Group
4
.\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
6
.\" Manual: PostgreSQL 9.1beta1 Documentation
7
.\" Source: PostgreSQL 9.1beta1
10
.TH "DROP TABLE" "7" "2011-04-27" "PostgreSQL 9.1beta1" "PostgreSQL 9.1beta1 Documentation"
11
.\" -----------------------------------------------------------------
12
.\" * set default formatting
13
.\" -----------------------------------------------------------------
14
.\" disable hyphenation
16
.\" disable justification (adjust text to left margin only)
18
.\" -----------------------------------------------------------------
19
.\" * MAIN CONTENT STARTS HERE *
20
.\" -----------------------------------------------------------------
22
DROP_TABLE \- remove a table
27
DROP TABLE [ IF EXISTS ] \fIname\fR [, \&.\&.\&.] [ CASCADE | RESTRICT ]
32
removes tables from the database\&. Only its owner can drop a table\&. To empty a table of rows without destroying the table, use
38
always removes any indexes, rules, triggers, and constraints that exist for the target table\&. However, to drop a table that is referenced by a view or a foreign\-key constraint of another table,
40
must be specified\&. (CASCADE
41
will remove a dependent view entirely, but in the foreign\-key case it will only remove the foreign\-key constraint, not the other table entirely\&.)
46
Do not throw an error if the table does not exist\&. A notice is issued in this case\&.
51
The name (optionally schema\-qualified) of the table to drop\&.
56
Automatically drop objects that depend on the table (such as views)\&.
61
Refuse to drop the table if any objects depend on it\&. This is the default\&.
65
To destroy two tables,
74
DROP TABLE films, distributors;
81
This command conforms to the SQL standard, except that the standard only allows one table to be dropped per command, and apart from the
87
ALTER TABLE (\fBALTER_TABLE\fR(7)), CREATE TABLE (\fBCREATE_TABLE\fR(7))