4 DROP TABLE — remove a table
8 DROP TABLE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
12 DROP TABLE removes tables from the database. Only the table owner, the
13 schema owner, and superuser can drop a table. To empty a table of rows
14 without destroying the table, use DELETE or TRUNCATE.
16 DROP TABLE always removes any indexes, rules, triggers, and constraints
17 that exist for the target table. However, to drop a table that is
18 referenced by a view or a foreign-key constraint of another table,
19 CASCADE must be specified. (CASCADE will remove a dependent view
20 entirely, but in the foreign-key case it will only remove the
21 foreign-key constraint, not the other table entirely.)
26 Do not throw an error if the table does not exist. A notice is
30 The name (optionally schema-qualified) of the table to drop.
33 Automatically drop objects that depend on the table (such as
34 views), and in turn all objects that depend on those objects
38 Refuse to drop the table if any objects depend on it. This is
43 To destroy two tables, films and distributors:
44 DROP TABLE films, distributors;
48 This command conforms to the SQL standard, except that the standard
49 only allows one table to be dropped per command, and apart from the IF
50 EXISTS option, which is a PostgreSQL extension.
54 ALTER TABLE, CREATE TABLE