SHOW TYPES

On this page Carat arrow pointing down
Warning:
GA releases for CockroachDB v23.1 are no longer supported. Cockroach Labs will stop providing LTS Assistance Support for v23.1 LTS releases on November 13, 2025. Prior to that date, upgrade to a more recent version to continue receiving support. For more details, refer to the Release Support Policy.

The SHOW TYPES statement lists the user-defined data types in the current database.

Note:

CockroachDB currently only supports enumerated user-defined types. As a result, SHOW ENUMS and SHOW TYPES return the same results.

Syntax

SHOW TYPES

Required privileges

The CONNECT privilege on the database is required to list any user-defined types in the database.

Examples

The following example creates a user-defined type.

icon/buttons/copy
> CREATE TYPE weekday AS ENUM ('monday', 'tuesday', 'wednesday', 'thursday', 'friday');
icon/buttons/copy
> CREATE TYPE weekend AS ENUM ('sunday', 'saturday');
icon/buttons/copy
> SHOW TYPES;
  schema |  name   |                  value
---------+---------+-------------------------------------------
  public | weekday | monday|tuesday|wednesday|thursday|friday
  public | weekend | sunday|saturday
(2 rows)

See also


Yes No
On this page

Yes No