PostgreSQL drop table (zh)

Source: Internet
Author: User
Name

Drop table -- delete a table

Synopsis
 
Drop TableName[,...] [Cascade | restrict]
Description

Drop tableDelete a table or view from a database. Only the owner of a table or view can be deleted. To clear a table without deleting the table, useDelete.

Drop tableAlways delete any existing indexes, rules, triggers, and constraints on the target table. However, to delete a table that has a view or other tables referenced by foreign key constraints, we must declareCascade. (CascadeThe referenced view will be deleted, but if it is a foreign key constraint, only the foreign key constraint will be deleted, rather than the other table .)

Parameters
Name

Name of the existing table to be deleted (it can be modified in the mode ).

Cascade

Automatically delete objects dependent on tables. (For example, view ).

Restrict

If a dependency object exists, the table is denied to be deleted. This is the default value.

Example

DeleteFilmsAndDistributorsTable:

 
Drop TableFilms, distributors;
Compatibility

This command is compatible with SQL standards. The standard only allows one command to delete a table.

 

Http://www.php100.com/manual/PostgreSQL8/sql-droptable.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.