-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add support for COPY FROM DATABASE statement #9765
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
Conversation
|
Great feature!
|
|
Thanks for having a look - I've addressed the comments. Should work more as expected now |
|
I read through the CLI dot commands today. Almost all of the SQLite commands are now supported, except It seems |
Merge pull request duckdb/duckdb#9765 from Mytherin/copydatabase
This PR adds support for a new COPY syntax that allows an entire database to be copied from one attached database to another attached database.
Syntax
Full example
Description
All catalog entries are copied from the source database to the target database. This includes schemas, tables, views, macros, sequences and types. The copy happens in two parts. First all schema elements are copied over. Then, if
(SCHEMA)is not specified, all data is copied over from the source database to the target database. Data is copied over internally by essentially running queries in the form ofINSERT INTO db2.tbl SELECT * FROM db1.tbl.Limitations
CREATE INDEX) are not copied.schema.sqlorder #8619 and [DependencyManager] Rework internals of the DependencyManager #9715. As a result this might not work correctly when there are e.g. foreign key constraints in the source database.