Skip to content
65 changes: 62 additions & 3 deletions modules/ROOT/pages/queries/select-version.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,77 @@ Databases created on, or migrated to, Neo4j 2025.06 or later will continue to ha
This is true for link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/#manage-database-systems[system, standard, and composite] Neo4j databases.
However, it is possible to set a different default language on both new and existing system, standard, and composite databases.

For more information about how to change and view the default language of new and existing databases and remote database aliases, and for how to set the necessary privilege to change the default language of a standard or composite database, see the following links in the Operations Manual:
To select a default Cypher version when creating a database, add `DEFAULT LANGUAGE <language version>` to the link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/standard-databases/create-databases/[`CREATE DATABASE`] statement.

.Select default Cypher version when creating a database
[.tabbed-example]
=====
[.include-with-Cypher-25]
======

.Cypher 25
[source,cypher]
----
CREATE DATABASE actors DEFAULT LANGUAGE CYPHER 25
----

======
[.include-with-Cypher-5]
======

.Cypher 5
[source,cypher]
----
CREATE DATABASE movies DEFAULT LANGUAGE CYPHER 5
----

======
=====

To alter the default Cypher version on an existing database, add `SET DEFAULT LANGUAGE <language version>` to the link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/standard-databases/alter-databases/[`ALTER DATABASE`] command.

.Alter the default Cypher version on an existing database
[.tabbed-example]
=====
[.include-with-Cypher-25]
======

.Cypher 25
[source,cypher]
----
ALTER DATABASE movies SET DEFAULT LANGUAGE CYPHER 25
----

======
[.include-with-Cypher-5]
======

.Cypher 5
[source,cypher]
----
ALTER DATABASE actors SET DEFAULT LANGUAGE CYPHER 5
----

======
=====

Selecting `CYPHER 25` ensures that all queries run on that database will be executed using Cypher 25 as it exists in the version of Neo4j that the database is currently running, provided it is on Neo4j 2025.06 or later (unless a query is prepended with xref:selection-query-cypher-version[`CYPHER 5`], which overrides this default).

Selecting `CYPHER 5` as the default database language ensures that all queries run on that database uses Cypher 5 as it existed at the time of the Neo4j 2025.06 release (unless a query is prepended with xref:selection-query-cypher-version[`CYPHER 25`], which overrides this default).
Any changes introduced after the 2025.06 release will not affect the semantics of the query.

For more information about how to change and view the default language of new and existing databases and remote database aliases, and for how to set the necessary privileges to change the default language of a database, see the following links in the Operations Manual:

* link:{neo4j-docs-base-uri}/operations-manual/current/configuration/cypher-version-configuration/[Configure the Cypher default version]
* link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/standard-databases/create-databases/#_set_a_default_cypher_version_for_a_standard_database[Set a default Cypher version for a standard database]
* link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/composite-databases/create-composite-databases/#composite-databases-default-language[Set a default Cypher version for a composite database]
* link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/aliases/manage-aliases-standard-databases/#set-default-language-for-remote-database-aliases[Set a default Cypher version for remote database aliases]
* link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/standard-databases/alter-databases/#alter-database-default-language[Alter the default Cypher version of an existing database]
* link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/composite-databases/alter-composite-databases/#_alter_the_default_cypher_version_of_a_composite_database[Alter the default Cypher version of a composite database]
* link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/composite-databases/alter-composite-databases/#alter-default-language-composite-database[Alter the default Cypher version of a composite database]
* link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/aliases/manage-aliases-standard-databases/#alter-default-language-remote-database-alias[Alter the default Cypher version of a remote database alias]
* link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/standard-databases/listing-databases/#_show_the_default_cypher_version_of_a_database[Show the default Cypher version of a database]
* link:{neo4j-docs-base-uri}/operations-manual/authentication-authorization/dbms-administration/#_grant_privilege_to_modify_the_default_language_of_standard_databases[Grant privilege to modify the default language of standard databases]
* * link:{neo4j-docs-base-uri}/operations-manual/authentication-authorization/dbms-administration/#_grant_privilege_to_modify_composite_databases[Grant privilege to modify composite databases] (required in order to alter the default language of a composite database)
* link:{neo4j-docs-base-uri}/operations-manual/authentication-authorization/dbms-administration/#_grant_privilege_to_modify_composite_databases[Grant privilege to modify composite databases] (required in order to alter the default language of a composite database)

For information about Cypher versions and DBMS upgrades, see the link:{neo4j-docs-base-uri}/upgrade-migration-guide/current/_cypher_versions[Upgrade and migration guide -> Cypher versions].

Expand Down