Postgres Enums

Create an enum type with:

CREATE TYPE user_status AS ENUM ('online', 'offline', 'dormant');

Use it in a table:

CREATE TABLE users (
    name text,
    status user_status
);

Add values to it:

INSERT INTO users VALUES ('Alice', 'online');
-- INSERT 0 1
INSERT INTO users VALUES ('Bob', 'invalid');
-- ERROR:  22P02: invalid input value for enum user_status: "invalid"

Reference

Edit