Answers for "postgres alter table add check constraint"

SQL
2

alter constraint postgres

/* Drop your constraint */
alter table yourtable drop constraint constraint_name;

/* Create new constraint */
alter table yourtable add constraint "constraint_name" FOREIGN KEY (some_id) REFERENCES yourtable(some_id) on delete cascade;
Posted by: Guest on February-02-2021
0

how to add CHECK constraint to a column in postgres

alter table foo 
   add constraint check_positive check (some_code in ('A','B'));
Posted by: Guest on August-13-2021

Code answers related to "postgres alter table add check constraint"

Code answers related to "SQL"

Browse Popular Code Answers by Language