-
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 5 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,12 +3,46 @@ | |
| [[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`. | ||
| 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. | ||
| 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 targets only composite databases, while the second one targets any database. | ||
|
|
||
| .Query | ||
| [source, cypher] | ||
| ---- | ||
| DROP COMPOSITE DATABASE inventory | ||
| ---- | ||
|
|
||
| [[composite-databases-delete-with-aliases]] | ||
| == Delete a composite database with constituent database aliases | ||
|
|
||
| There are two ways of dropping a composite database with constituent database aliases (local or remote): | ||
|
|
||
| * Drop the constituent database aliases first, then use `DROP COMPOSITE DATABASE name` to drop the composite database. | ||
| * Use `DROP COMPOSITE DATABASE name CASCADE ALIASES` to also drop the constituent database aliases while dropping the composite database. | ||
| This operation does not drop the actual target database of the constituent database aliases. | ||
|
|
||
| Using `CASCADE ALIASES` requires the `DROP ALIAS` privilege. | ||
| For more information, 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 are dropped when using the `CASCADE ALIASES` option can be found in the `constituents` column of `SHOW DATABASE`. | ||
| ==== | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.