Drops a zone (fails if it contains schemas).
DROP ZONE [IF EXISTS] <name>
## Overview Removes a zone from the control plane catalog. Zones are the top-level namespace containers in the DeltaForge three-level hierarchy (zone.schema.table). Dropping a zone removes it from the catalog and makes its namespace unavailable. ## Behavior - The zone must be empty (contain no schemas). If schemas remain in the zone, the command fails with an error. Drop all schemas first. - If IF EXISTS is specified and the zone does not exist, the statement completes successfully without error. - If IF EXISTS is omitted and the zone does not exist, the command returns a ZoneNotFound error. - The command is routed through the control plane catalog API. A valid catalog router connection is required. - Dropping a zone does not affect underlying data files or storage paths. It only removes the catalog metadata. - Any permissions granted at the zone level are removed along with the zone. ## Compatibility DROP ZONE is a DeltaForge extension. Zones serve the same organizational role as top-level databases in traditional SQL systems.
-- Drop a temporary zone
DROP ZONE temp_zone;
-- Drop a zone only if it exists
DROP ZONE IF EXISTS staging;
-- Clean up a decommissioned zone (schemas must be dropped first)
DROP SCHEMA IF EXISTS legacy.raw;
DROP SCHEMA IF EXISTS legacy.processed;
DROP ZONE legacy;