MogDB
Ecological Tools
Doc Menu

DROP DATA SOURCE

Function

DROP DATA SOURCE deletes a data source.

Important Notes

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.
mogdb=# CREATE DATA SOURCE ds_tst1;

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