-
Couldn't load subscription status.
- Fork 83
Add DROP DATABASE name CASCADE ALIASES
#1805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
488a86d
5b7e27e
994f3b9
41be4e4
821a506
6b05ee1
767b535
32a35f9
2c5af59
4023823
c42b313
99ed2bc
8ed9ecd
c670df8
a2e6614
1afc7d8
41a79e8
b714145
31d1e6b
5b88e8c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| [[composite-databases-delete]] | ||
| = Delete composite databases | ||
|
|
||
| You can delete composite databases using either the command `DROP COMPOSITE DATABASE name` or the more general one `DROP DATABASE name`. | ||
| You can delete composite databases using either the command `DROP COMPOSITE DATABASE name` or the more general one `DROP DATABASE name`. | ||
| However, keep in mind that the first command will fail if the target database is not composite, while the second one will not fail because it targets any database. | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| .Query | ||
|
|
@@ -12,3 +12,37 @@ However, keep in mind that the first command will fail if the target database is | |
| DROP COMPOSITE DATABASE inventory | ||
| ---- | ||
|
|
||
| [[composite-databases-delete-with-aliases]] | ||
| == Delete a composite database with constituent database aliases | ||
|
|
||
| In general, deleting a composite database that has constituent database aliases will fail as these aliases need to be dropped first. | ||
| This applies to both the local and remote constituent database aliases belonging to the specified composite database. | ||
|
|
||
| By appending `CASCADE ALIASES` to the command `DROP COMPOSITE DATABASE`, those constituent database aliases can be dropped alongside the composite database. | ||
| This affects both the local and remote constituent database aliases belonging to the specified composite database. | ||
Hunterness marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| However, the behavior does not cascade further, the target of those constituent database aliases are not dropped. | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Using `CASCADE ALIASES` requires the `DROP ALIAS` privilege (see xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-alias-management[ALIAS MANAGEMENT privileges]). | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Given composite database and database alias: | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| [source, cypher] | ||
| ---- | ||
| CREATE COMPOSITE DATABASE movies | ||
| CREATE ALIAS movies.sweden FOR DATABASE `swedish-movies` | ||
| ---- | ||
|
|
||
| Then both the constituent database alias `sweden` and the composite database `movies` will be dropped with: | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| [source, cypher] | ||
| ---- | ||
| DROP COMPOSITE DATABASE movies CASCADE ALIASES | ||
Hunterness marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ---- | ||
|
|
||
| This behavior would be the same for the more general command `DROP DATABASE name` when using it to drop a composite database. | ||
|
|
||
| The option `RESTRICT` explicitly requests the default behavior of the command. | ||
|
||
|
|
||
| [NOTE] | ||
| ==== | ||
| For composite databases, the aliases that will be dropped when using the `CASCADE ALIASES` option can be found in the `constituents` column of `SHOW DATABASE`. | ||
renetapopova marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ==== | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.