DROP TABLE v12

Use the PostgreSQL DROP TABLE command to remove a partitioned table definition, it's partitions and subpartitions, and delete 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. When you delete a table, any partitions or subpartitions (of that table) are deleted as well.

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, to delete the sales table, invoke the following command:

DROP TABLE sales;

The server will confirm that the table has been dropped.

edb=# drop table sales;
DROP TABLE
edb=#

For more information about the DROP TABLE command, see the PostgreSQL core documentation at:

https://www.postgresql.org/docs/12/static/sql-droptable.html