Pgsql inserts datagram id primary key violation of non-null constraint solution

Setting the sequence of the primary key can solve

第一步:创建序列
create sequence sde.gbnt_2019_seq minvalue 1 maxvalue 99999999    
         increment by 1    
         start with 1; 
第二步:给字段绑定序列		 
alter table zjd_sqzggg alter column id set default nextval('sde.gbnt_2019_seq')				 

Guess you like

Origin blog.csdn.net/wei1359765074410/article/details/122910975