Updated on 2025-05-29 GMT+08:00

DROP TYPE

Description

Drops a user-defined data type.

Precautions

Only the owner of a type, a user granted the DROP permission on a type, or a user granted the DROP ANY TYPE permission on a sequence can run the DROP TYPE command. When separation of duties is disabled, a system administrator has this permission by default.

Syntax

DROP TYPE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ];

Parameters

  • IF EXISTS

    Reports a notice instead of an error if the specified type does not exist.

  • name

    Specifies the name (optionally schema-qualified) of the type to be deleted.

  • CASCADE

    Automatically deletes the objects (such as columns, functions, and operators) that depend on the type.

  • RESTRICT

    Refuses to delete the type if any objects depend on it. This is the default action.

Examples

For details, see Examples.

Helpful Links

CREATE TYPE and ALTER TYPE