postgres 更新数据表

新增非空列:

alter table t_test add column user_id integer;
update t_test set user_id=0;
alter table t_test alter column user_id SET NOT NULL;

原文地址:https://www.cnblogs.com/kedarui/p/6483635.html