Updated on 2024-05-07 GMT+08:00

DROP TABLE

Function

DROP TABLE deletes a time series table.

Precautions

DROP TABLE forcibly deletes a specified table. After a table is deleted, any indexes that exist for the table will be deleted, and any stored procedures that use this table cannot be run. When a partition table is deleted, all partitions in the partition table are deleted, and the partition creation and deletion tasks of the table are also cleared.

Syntax

1
2
DROP TABLE [ IF EXISTS ]
{ [schema.]table_name } [, ...] [ CASCADE | RESTRICT ];

Description

  • IF EXISTS

    Reports a notice instead of an error if the specified table does not exist.

  • schema

    Specifies the schema name.

  • table_name

    Specifies the name of the table to be deleted.

  • CASCADE | RESTRICT
    • CASCADE: Automatically deletes the objects, such as views, that depend on the table.
    • RESTRICT: refuses to delete the table if any objects depend on it. This is a default parameter.

Example

Delete a simple time series table.

1
DROP TABLE CPU;