CREATE TYPE PRODUCT AS ENUM ('phone', 'laptop', 'mouse');
CREATE TABLE products (
id BIGSERIAL NOT NULL PRIMARY KEY,
title VARCHAR(20) NOT NULL,
type PRODUCT NOT NULL
);
Caused by: org.postgresql.util.PSQLException: ERROR: column "type" is of type product but expression is of type character varying
Hint: You will need to rewrite or cast the expression.