DROP TABLE v17
Use the PostgreSQL DROP TABLE
command to remove a partitioned table definition, its partitions and subpartitions, and the table contents. The syntax is:
DROP TABLE <table_name>
Parameters
table_name
The name (optionally schema-qualified) of the partitioned table.
Description
The DROP TABLE
command removes an entire table and the data that resides in that table. Deleting a table deletes any partitions or subpartitions of that table.
To use the DROP TABLE
command, you must be the owner of the partitioning root, a member of a group that owns the table, the schema owner, or a database superuser.
Example
To delete a table, connect to the controller node (the host of the partitioning root), and invoke the DROP TABLE
command. For example, delete the sales
table:
DROP TABLE sales;
The server confirms that the table was dropped:
edb=# drop table sales; DROP TABLE edb=#
For more information about the DROP TABLE
command, see the PostgreSQL core documentation.
- On this page
- Parameters
- Description
- Example