The Lakehouse runtime catalog lets you delete namespaces from
[catalog endpoints](https://docs.cloud.google.com/lakehouse/docs/about-lakehouse-catalogs.md.txt#configuration) to
unregister the namespace in borderless Lakehouse.

Deleting a namespace removes it from Lakehouse, but it
doesn't automatically delete the underlying Cloud Storage bucket or your stored
data files. You can't delete a namespace that still contains tables.

## Before you begin

1. Read [About the Lakehouse runtime catalog](https://docs.cloud.google.com/lakehouse/docs/about-lakehouse-catalogs.md.txt) to understand how the Lakehouse runtime catalog works and the limitations for the service.

### Required roles


To get the permissions that
you need to delete a namespace,

ask your administrator to grant you the
following IAM roles on your project:

- All:
  - [BigLake Admin](https://docs.cloud.google.com/iam/docs/roles-permissions/biglake.md.txt#biglake.admin) (`roles/biglake.admin`)
  - [Storage Admin](https://docs.cloud.google.com/iam/docs/roles-permissions/storage.md.txt#storage.admin) (`roles/storage.admin`)


For more information about granting roles, see [Manage access to projects, folders, and organizations](https://docs.cloud.google.com/iam/docs/granting-changing-revoking-access.md.txt).


You might also be able to get
the required permissions through [custom
roles](https://docs.cloud.google.com/iam/docs/creating-custom-roles) or other [predefined
roles](https://docs.cloud.google.com/iam/docs/roles-overview#predefined).

## Delete a namespace

Delete a namespace from a catalog.

### Console

1. In the Google Cloud console, go to the **Lakehouse** page.

   [Go to Lakehouse](https://console.cloud.google.com/biglake)
2. Select the catalog that contains the namespace to delete.

3. In the row of the namespace that you're deleting, click

   **More namespace actions \> Delete**.

4. In the confirmation dialog, enter `delete` to confirm, and then click **Delete**.

### gcloud

To delete a namespace using `gcloud`, run the [`gcloud biglake iceberg namespaces delete` command](https://docs.cloud.google.com/sdk/gcloud/reference/biglake/iceberg/namespaces/delete).

```bash
gcloud biglake iceberg namespaces delete NAMESPACE_NAME \
    --project="PROJECT_ID" \
    --catalog="CATALOG_ID"
```

Replace the following:

- `NAMESPACE_NAME`: the name of your namespace.
- `PROJECT_ID`: your Google Cloud project ID.
- `CATALOG_ID`: the ID of your catalog.

### REST

To delete a namespace using the REST API, make a `DELETE` request to the
[`DeleteIcebergNamespace`](https://docs.cloud.google.com/lakehouse/docs/reference/rest/v1/iceberg.v1.restcatalog.v1.projects.catalogs.namespaces/delete.md.txt) endpoint:

    DELETE /iceberg/v1/restcatalog/v1/projects/PROJECT_ID/catalogs/CATALOG_ID/namespaces/NAMESPACE_NAME

> [!NOTE]
> **Note:** You cannot delete a namespace that still contains tables.

Replace the following:

- `PROJECT_ID`: your Google Cloud project ID.
- `CATALOG_ID`: the ID of your catalog.
- `NAMESPACE_NAME`: the name of your catalog namespace.