Updated on 2023-10-23 GMT+08:00

DROP DATA SOURCE

Function

DROP DATA SOURCE deletes a data source.

Precautions

Only an owner, system administrator, or initial user can delete a data source.

Syntax

DROP DATA SOURCE [IF EXISTS] src_name [CASCADE | RESTRICT];

Parameter Description

  • src_name

    Specifies the name of the data source to be deleted.

    Value range: a string. It must comply with the naming convention.

  • IF EXISTS

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

  • CASCADE | RESTRICT
    • CASCADE: automatically deletes the objects that depend on the data source.
    • RESTRICT: refuses to delete the data source if any objects depend on it. This is the default action.

      Currently, no objects depend on data sources. Therefore, CASCADE is equivalent to RESTRICT, and they are reserved to ensure backward compatibility.

Examples

-- Create a data source.
openGauss=# CREATE DATA SOURCE ds_tst1;

-- Delete the data source.
openGauss=# DROP DATA SOURCE ds_tst1 CASCADE;
openGauss=# DROP DATA SOURCE IF EXISTS ds_tst1 RESTRICT;