Detach and re-attach a MotherDuck database
After creating a remote MotherDuck database,
the DETACH <database>
command may be used to detach it.
This will prevent access and modifications to the database until it is re-attached using the ATTACH <database>
command.
This pattern can be used to isolate queries and changes to a specific set of databases.
Note that this is a convenience feature and not a security feature, as a MotherDuck database may be reattached at any time.
Database shares behave slightly differently than non-shared databases, so if you want to ATTACH
and DETACH
shares, please have a look at how to manage shared MotherDuck databases.