DROP TABLE -- remove a table
DROP TABLE name [, ...] [ CASCADE | RESTRICT ]
The name (optionally schema-qualified) of an existing table to drop.
Automatically drop objects that depend on the table
(such as views).
Refuse to drop the table if there are any dependent objects.
This is the default.
- DROP TABLE
The message returned if the command completes successfully.
- ERROR: table " name" does not exist
If the specified table does not exist in the database.
DROP TABLE removes tables from the database.
Only its owner may destroy a table. A table may be emptied of rows, but not
destroyed, by using DELETE.
DROP TABLE always removes any indexes, rules,
triggers, and constraints that exist for the target table. However,
to drop a table that is referenced by a foreign-key constraint of another
table, CASCADE must be specified. (CASCADE will remove the foreign-key
constraint, not the other table itself.)
Refer to CREATE TABLE and
ALTER TABLE for information on
how to create or modify tables.
To destroy two tables, films and
DROP TABLE films, distributors;
This file was copied from PostgreSQL 7.3.1 help system.