DROP COLLECTION
The DROP COLLECTION statement removes an empty collection - the layer between a
workspace and its tables/views (workspace.collection.table).
Syntax
DROP COLLECTION [ IF EXISTS ] <workspace>.<collection>;Parameters
<workspace>.<collection>— the collection to drop, fully qualified by its workspace.IF EXISTS— skip the operation without error if the collection does not exist, instead of refusing the statement.
Examples
Drop a Collection
DROP COLLECTION workspace.staging;Drop Only If It Exists
DROP COLLECTION IF EXISTS workspace.staging;Notes
- The collection must be empty - drop every table and view in it first with
DROP TABLE / DROP VIEW.
DROP COLLECTIONnever cascades and never removes tables or views on your behalf.CASCADEis rejected when the query is planned, rather than accepted and quietly not honoured. - Collections come into existence implicitly, with the first table or view created in them. CREATE COLLECTION makes one ahead of its first relation, but is never required.
- Requires the
ownerrole on the collection itself, not just on the tables inside it - a grant likeworkspace.staging.*covers everything in the collection but does not match the collection's own name, so it does not grantDROP COLLECTION. You need a pattern that matchesworkspace.stagingdirectly, such as an exact grant onworkspace.stagingor a workspace-wideworkspace.*. See Security & Permissions.