Source: https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph/rename/ Documentation version: v5.3.2 # RENAME GRAPH statement The RENAME GRAPH statement renames a graph in the schema of the current session or a specified schema. Note Renaming temporary graphs is not supported. 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](https://dev-docs.nebula-graph.io/v5.3.2/server-admin/authorization/schema-access-control/). ## Prerequisites - A graph is created. For more information, see [CREATE GRAPH](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph/create/). - To rename a graph, you must either be the owner of the graph, be granted to perform the action `ALTER` on the graph, or be granted to perform the action `ALTER ANY GRAPH` on the corresponding schema. For more information, see [Roles and privileges](https://dev-docs.nebula-graph.io/v5.3.2/server-admin/authorization/). ## Syntax diagramsource rename_graph_statement ```` rename_graph_statement ::= 'RENAME' 'PROPERTY'? 'GRAPH' (schema_reference '/')? old_graph_name 'TO' (schema_reference '/')? new_graph_name ```` ## Parameters ### `schema_reference` The reference to the path of the schema. It specifies the schema path of the graph to be renamed here. - Both absolute and relative schema paths can be used in the statement. To rename the graph that is not in the schema of the current session, the schema path must be specified. For information about setting and viewing the schema, see [SESSION SET](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/sessions/set/) and [SHOW CURRENT_SCHEMA](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/data-admin/show/show-current-schema/). - The schema path of the graph cannot be changed after renaming. ### `old_graph_name` The current name of the graph. ### `new_graph_name` The new name of the graph. ## Examples The following examples are based on the [example dataset](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/overview/example-dataset/). ### Rename a graph in the current schema ```` RENAME GRAPH movie TO movie_renamed ```` The preceding example renames the graph `movie` to `movie_renamed`. ### Rename a graph in the specified schema ```` RENAME GRAPH /default_schema/my_graph TO /default_schema/my_graph_renamed ```` The preceding example renames the graph `my_graph` created in the Examples section of [CREATE GRAPH](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/graph/create/#create_a_graph_in_a_specified_schema) to `my_graph_renamed`.