postgres设置字段可为空约束与非空约束
1、设置非空约束
alter table [tab_name] alter COLUMN [col_name] set not null;
2、设置可为空约束
alter table [tab_name] alter COLUMN [col_name] drop not null;
alter table [tab_name] alter COLUMN [col_name] set not null;
alter table [tab_name] alter COLUMN [col_name] drop not null;