Answer the question
In order to leave comments, you need to log in
Why doesn't changing the table work?
Why does not work like everything is done correctly. The table has already been created. This is just an example
create table persons(
rols varchar(30) not null
);
alter table persons
alter column rols
add check (rols in('registrator', 'coordinator', 'user'))
Answer the question
In order to leave comments, you need to log in
Melkij , the case speaks)
see PostgreSQL CHECK Constraint
ALTER TABLE persons
ADD CONSTRAINT persons_check_rols CHECK (rols in('registrator', 'coordinator', 'user'));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question