DROP GRAPH TYPE statement¶
The DROP GRAPH TYPE statement destroys a graph type in the schema of the current session or a specified schema.
Note
An operation involving a non-default schema or an object in it requires access to the schema, either implicitly or through an explicit USAGE grant, as well as the privilege required for the operation. The schema access check and the privilege check for the requested operation are independent; satisfying one does not satisfy the other. Schema access control does not apply to temporary graphs or built-in procedures and functions. For more information, see Schema access control.
Prerequisites¶
- A graph type is created. For more information, see CREATE GRAPH TYPE.
- No graph of the graph type exists.
- To drop a graph type, you must either be the owner of the graph type, be granted to perform the action
DROPon the graph type, or be granted to perform the actionDROP ANY GRAPH TYPEon the corresponding schema. For more information, see Roles and privileges.
Syntax¶
- drop_graph_type_statement
drop_graph_type_statement ::=
'DROP' 'PROPERTY'? 'GRAPH TYPE' ('IF EXISTS')? (schema_reference '/')? graph_type_name
Parameters¶
IF EXISTS¶
This clause checks if the graph type to be destroyed exists. If it does not exist, the graph type is not destroyed and no exception is thrown.
If you do not specify this clause, an exception is thrown if the graph type to be destroyed does not exist.
schema_reference¶
The reference to the path of the schema. It specifies the schema path of the graph type to be destroyed here.
Both absolute and relative schema paths can be used in the statement. To drop a graph type that resides outside the schema in the current session, the schema path must be specified. For information about setting and viewing the schema, see SESSION SET and SHOW CURRENT_SCHEMA.
graph_type_name¶
The name of the graph type to be destroyed.
Examples¶
Destroy a graph type in the current schema¶
DROP GRAPH TYPE movie_type
The preceding example destroys the graph type movie_type introduced in Example dataset.
Destroy a graph type in the specified schema¶
DROP GRAPH TYPE /default_schema/my_graph_type
The preceding example destroys the graph type that is created in the Examples section of CREATE GRAPH TYPE.