drop_table.7

来自「PostgreSQL 8.2中增加了很多企业用户所需要的功能和性能上的提高,其开」· 7 代码 · 共 58 行

7
58
字号
.\\" auto-generated by docbook2man-spec $Revision: 1.1.1.1 $.TH "DROP TABLE" "" "2008-01-03" "SQL - Language Statements" "SQL Commands".SH NAMEDROP TABLE \- remove a table.SH SYNOPSIS.sp.nfDROP TABLE [ IF EXISTS ] \fIname\fR [, ...] [ CASCADE | RESTRICT ].sp.fi.SH "DESCRIPTION".PP\fBDROP TABLE\fR removes tables from the database.Only its owner may destroy a table. To empty a table of rowswithout destroying the table, use DELETE [\fBdelete\fR(7)] or TRUNCATE [\fBtruncate\fR(l)]..PP\fBDROP TABLE\fR 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-keyconstraint of another table, CASCADE must bespecified. (CASCADE will remove a dependent view entirely,but in the foreign-key case it will only remove the foreign-keyconstraint, not the other table entirely.).SH "PARAMETERS".TP\fBIF EXISTS\fRDo not throw an error if the table does not exist. A notice is issued in this case..TP\fB\fIname\fB\fRThe name (optionally schema-qualified) of the table to drop..TP\fBCASCADE\fRAutomatically drop objects that depend on the table (such asviews)..TP\fBRESTRICT\fRRefuse to drop the table if any objects depend on it. This isthe default..SH "EXAMPLES".PPTo destroy two tables, films and distributors:.sp.nfDROP TABLE films, distributors;.sp.fi.SH "COMPATIBILITY".PPThis command conforms to the SQL standard, except that the standard onlyallows one table to be dropped per command, and apart from the IF EXISTS option, which is a PostgreSQL extension..SH "SEE ALSO"ALTER TABLE [\fBalter_table\fR(7)], CREATE TABLE [\fBcreate_table\fR(l)]

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?