Groups
Groups
Sign in
Groups
Groups
ClickHouse: https://clickhouse.com/slack
Conversations
Labels
About
Send feedback
Help
Is there a way to move a table to a different database?
11 views
Skip to first unread message
Michal Singer
unread,
Jun 9, 2020, 2:48:53 AM
6/9/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ClickHouse
Hi, I create a table under default database and now i want to move it to a different database.
Is there a way to do this?
Thanks
Muli Golan
unread,
Jun 9, 2020, 2:52:00 AM
6/9/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ClickHouse
1. Create the table in the database you would like it to be in.
2. detach all partitions from old table
3. move the files of the detached partitions to the folder detached under the new table name
4. attach the partitions
Michal Singer
unread,
Jun 9, 2020, 3:43:47 AM
6/9/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ClickHouse
Thanks, is there a simpler way to do this?
Denis Zhuravlev
unread,
Jun 9, 2020, 6:34:43 AM
6/9/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ClickHouse
Rename table old_db.t to new_db.t
Reply all
Reply to author
Forward
0 new messages