> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cockroachlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DROP TYPE

The `DROP TYPE` [statement](https://docs.cockroachlabs.com/docs/stable/sql-statements.md) drops a specified [enumerated data type](https://docs.cockroachlabs.com/docs/stable/enum.md) from the current database.

> [!NOTE]
>
> The `DROP TYPE` statement performs a schema change. For more information about how online schema changes work in CockroachDB, see [Online Schema Changes](https://docs.cockroachlabs.com/docs/stable/online-schema-changes.md).

## Synopsis

![drop\_type syntax diagram](https://mintcdn.com/cockroachlabs/O8LdfYQ-dz7oGPVh/images/sql-diagrams/v24.2/drop_type.svg?fit=max\&auto=format\&n=O8LdfYQ-dz7oGPVh\&q=85\&s=07e0f89c3e399f604bb393b56e6c5fd5)

## Parameters

| Parameter | Description |
| - | - |
| `IF EXISTS` | Drop the type if it exists. If it does not exist, do not return an error. |
| `type_name_list` | A type name or a comma-separated list of type names to drop. |

## Required privileges

The user must be the owner of the type.

## Details

* You cannot drop a type or view that is in use by a table.
* You can only drop a user-defined type from the database that contains the type.

## Examples

### Drop a single type

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> CREATE TYPE IF NOT EXISTS status AS ENUM ('open', 'closed', 'inactive');
```

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> SHOW ENUMS;
```

```
  schema |  name  |        value
---------+--------+-----------------------
  public | status | open|closed|inactive
(1 row)
```

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> CREATE TABLE IF NOT EXISTS accounts (
        id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
        balance DECIMAL,
        status status
);
```

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
-- sqlchecker: ignore
> DROP TYPE status;
```

```
ERROR: cannot drop type "status" because other objects ([bank.public.accounts]) still depend on it
SQLSTATE: 2BP01
```

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> DROP TABLE accounts;
```

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> DROP TYPE status;
```

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> SHOW ENUMS;
```

```
  schema | name | value
---------+------+--------
(0 rows)
```

### Drop multiple types

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> CREATE TYPE weekday AS ENUM ('monday', 'tuesday', 'wednesday', 'thursday', 'friday');
```

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> CREATE TYPE weekend AS ENUM ('sunday', 'saturday');
```

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> SHOW ENUMS;
```

```
  schema |  name   |                  value
---------+---------+-------------------------------------------
  public | weekday | monday|tuesday|wednesday|thursday|friday
  public | weekend | sunday|saturday
(2 rows)
```

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> DROP TYPE weekday, weekend;
```

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> SHOW ENUMS;
```

```
  schema | name | value
---------+------+--------
(0 rows)
```

## See also

* [`ENUM`](https://docs.cockroachlabs.com/docs/stable/enum)
* [Data types](https://docs.cockroachlabs.com/docs/stable/data-types.md)
* [`CREATE TYPE`](https://docs.cockroachlabs.com/docs/stable/create-type)
* [`ALTER TYPE`](https://docs.cockroachlabs.com/docs/stable/alter-type)
* [`SHOW ENUMS`](https://docs.cockroachlabs.com/docs/stable/show-enums)
