docs: mention SYNC modifier for DROP and DETACH statements

This commit is contained in:
Vincent Bernat 2022-09-08 15:21:59 +02:00
parent 507ad0c4d9
commit fab1b40928
2 changed files with 8 additions and 6 deletions

View File

@ -10,7 +10,7 @@ Makes the server "forget" about the existence of a table, a materialized view, o
**Syntax** **Syntax**
``` sql ``` sql
DETACH TABLE|VIEW|DICTIONARY [IF EXISTS] [db.]name [ON CLUSTER cluster] [PERMANENTLY] DETACH TABLE|VIEW|DICTIONARY [IF EXISTS] [db.]name [ON CLUSTER cluster] [PERMANENTLY] [SYNC]
``` ```
Detaching does not delete the data or metadata of a table, a materialized view or a dictionary. If an entity was not detached `PERMANENTLY`, on the next server launch the server will read the metadata and recall the table/view/dictionary again. If an entity was detached `PERMANENTLY`, there will be no automatic recall. Detaching does not delete the data or metadata of a table, a materialized view or a dictionary. If an entity was not detached `PERMANENTLY`, on the next server launch the server will read the metadata and recall the table/view/dictionary again. If an entity was detached `PERMANENTLY`, there will be no automatic recall.
@ -24,6 +24,8 @@ Note that you can not detach permanently the table which is already detached (te
Also you can not [DROP](../../sql-reference/statements/drop#drop-table) the detached table, or [CREATE TABLE](../../sql-reference/statements/create/table.md) with the same name as detached permanently, or replace it with the other table with [RENAME TABLE](../../sql-reference/statements/rename.md) query. Also you can not [DROP](../../sql-reference/statements/drop#drop-table) the detached table, or [CREATE TABLE](../../sql-reference/statements/create/table.md) with the same name as detached permanently, or replace it with the other table with [RENAME TABLE](../../sql-reference/statements/rename.md) query.
The `SYNC` modifier executes the action without delay.
**Example** **Example**
Creating a table: Creating a table:

View File

@ -6,7 +6,7 @@ sidebar_label: DROP
# DROP Statements # DROP Statements
Deletes existing entity. If the `IF EXISTS` clause is specified, these queries do not return an error if the entity does not exist. Deletes existing entity. If the `IF EXISTS` clause is specified, these queries do not return an error if the entity does not exist. If the `SYNC` modifier is specified, the entity is dropped without delay.
## DROP DATABASE ## DROP DATABASE
@ -15,7 +15,7 @@ Deletes all tables inside the `db` database, then deletes the `db` database itse
Syntax: Syntax:
``` sql ``` sql
DROP DATABASE [IF EXISTS] db [ON CLUSTER cluster] DROP DATABASE [IF EXISTS] db [ON CLUSTER cluster] [SYNC]
``` ```
## DROP TABLE ## DROP TABLE
@ -25,7 +25,7 @@ Deletes the table.
Syntax: Syntax:
``` sql ``` sql
DROP [TEMPORARY] TABLE [IF EXISTS] [db.]name [ON CLUSTER cluster] DROP [TEMPORARY] TABLE [IF EXISTS] [db.]name [ON CLUSTER cluster] [SYNC]
``` ```
## DROP DICTIONARY ## DROP DICTIONARY
@ -35,7 +35,7 @@ Deletes the dictionary.
Syntax: Syntax:
``` sql ``` sql
DROP DICTIONARY [IF EXISTS] [db.]name DROP DICTIONARY [IF EXISTS] [db.]name [SYNC]
``` ```
## DROP USER ## DROP USER
@ -95,7 +95,7 @@ Deletes a view. Views can be deleted by a `DROP TABLE` command as well but `DROP
Syntax: Syntax:
``` sql ``` sql
DROP VIEW [IF EXISTS] [db.]name [ON CLUSTER cluster] DROP VIEW [IF EXISTS] [db.]name [ON CLUSTER cluster] [SYNC]
``` ```
## DROP FUNCTION ## DROP FUNCTION