RENAME GRAPH TYPE statement¶
The RENAME GRAPH TYPE statement renames 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.
- To rename a graph type, you must either be the owner of the graph type, be granted to perform the action
ALTERon the graph type, or be granted to perform the actionALTER ANY GRAPH TYPEon the corresponding schema. For more information, see Roles and privileges.
Syntax¶
- rename_graph_type_statement
rename_graph_type_statement ::=
'RENAME' 'PROPERTY'? 'GRAPH TYPE' (schema_reference '/')? old_graph_type_name 'TO' (schema_reference '/')? new_graph_type_name
Parameters¶
schema_reference¶
The reference to the path of the schema. It specifies the schema path of the graph type to be renamed here.
- Both absolute and relative schema paths can be used in the statement. If you want to change the name of the graph type that is not in the schema of the current session, you must specify the schema path. For information about setting and viewing the schema, see SESSION SET and SHOW CURRENT_SCHEMA.
- The schema reference of the graph type cannot be changed.
old_graph_type_name¶
The current name of the graph type.
new_graph_type_name¶
The new name of the graph type.
Examples¶
The following examples are based on the example dataset.
Rename a graph type in the current schema¶
RENAME GRAPH TYPE movie_type TO movie_type_renamed
The preceding example renames the graph type movie_type to movie_type_renamed.
Rename a graph type in the specified schema¶
RENAME GRAPH TYPE /default_schema/my_graph_type TO /default_schema/my_graph_type_renamed
The preceding example renames the graph type that is created in the Examples section of CREATE GRAPH TYPE to my_graph_type_renamed.