Skip to content
masterclass Buddy

PostgreSQL · Type Alias

ENUM

PostgreSQL enum types define a fixed, ordered set of allowed labels. Create one with CREATE TYPE, then use it in tables and functions.

Last updated

Syntax

CREATE TYPE type_name AS ENUM ('value1', 'value2', ...);

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • CREATE TYPE
  • ALTER TYPE
  • enum_first
  • enum_last
  • enum_range
  • pg_enum

Source: PostgreSQL: Documentation: 18: 8.7. Enumerated Types. Checked 2026-11-03.