Postgresql – Can you add a constraint to an SQL column that checks the value of an enum?
I have a users table in my Postgres database with a role column that uses an enum. The user can either be a CAPTAIN or PLAYER. DROP TYPE IF EXISTS USER_ROLE CASCADE; CREATE TYPE USER_ROLE AS ENUM ('CAPTAIN', 'PLAYER'); CREATE…