5、postgres设置字段可为空约束与非空约束

发布时间 2023-09-19 16:43:49作者: 站着说话不腰疼

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;