mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Add documentation for ATTACH DATABASE
This commit is contained in:
parent
49d553369e
commit
f6733ac7ab
@ -10,10 +10,10 @@ Attaches a table or a dictionary, for example, when moving a database to another
|
||||
**Syntax**
|
||||
|
||||
``` sql
|
||||
ATTACH TABLE|DICTIONARY [IF NOT EXISTS] [db.]name [ON CLUSTER cluster] ...
|
||||
ATTACH TABLE|DICTIONARY|DATABASE [IF NOT EXISTS] [db.]name [ON CLUSTER cluster] ...
|
||||
```
|
||||
|
||||
The query does not create data on the disk, but assumes that data is already in the appropriate places, and just adds information about the table or the dictionary to the server. After executing the `ATTACH` query, the server will know about the existence of the table or the dictionary.
|
||||
The query does not create data on the disk, but assumes that data is already in the appropriate places, and just adds information about the specified table, dictionary or databse to the server. After executing the `ATTACH` query, the server will know about the existence of the table, dictionary or database.
|
||||
|
||||
If a table was previously detached ([DETACH](../../sql-reference/statements/detach.md) query), meaning that its structure is known, you can use shorthand without defining the structure.
|
||||
|
||||
@ -79,3 +79,13 @@ Attaches a previously detached dictionary.
|
||||
``` sql
|
||||
ATTACH DICTIONARY [IF NOT EXISTS] [db.]name [ON CLUSTER cluster]
|
||||
```
|
||||
|
||||
## Attach Existing Database
|
||||
|
||||
Attaches a previously detached database.
|
||||
|
||||
**Syntax**
|
||||
|
||||
``` sql
|
||||
ATTACH DATABASE [IF NOT EXISTS] name [ENGINE=<database engine>] [ON CLUSTER cluster]
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user